<template>
  <div class="home overflowY">
    <!--<div class="PageTitle"><i class="iconfont icon-jia"></i>逝者火ass="icdiv>-->
    <div class="PageContent" v-loading="loading">
      <el-form
        :model="ruleForm"
        :inline="true"
        ref="homeRuleForm"
        :rules="rules"
        class="demo-ruleForm"
        
        @submit.native.prevent
        label-width="100px"
      >
        <div class="PageItem margintop20">
          <el-row class="paddingleft2em">
            
            <el-form-item label="　业务编码" style="margin-bottom: 0">
              <el-input
                v-model="businessCodeTitle"
                ref="homebusinessCode"
                @keyup.enter.native="searchData"
                :maxlength="20"
                placeholder="请输入业务编码"
                style="width: 230px"
              >
                <el-button
                  type="primary"
                  slot="append"
                  icon="el-icon-circle-close"
                  @click="businessCodeTitle = ''"
                ></el-button>
                <el-button
                  type="primary"
                  slot="append"
                  icon="el-icon-search"
                  v-if="btnRight.btnBusinessCodeScanning"
                  @click="searchData"
                ></el-button>
              </el-input>
            </el-form-item>
            <!--<span v-if="btnRight.btnBusinessCodeScanning">(可扫描接运工单编号或逝者编码)</span>-->
            <el-button
              type="success"
              icon="el-icon-plus"
              style="margin-left: 20px"
              @click="AddInfo()"
              v-if="btnRight.btnAddFuneralBusiness"
            >新增逝者火化档案
            </el-button>
            <el-button
              type="primary"
              v-if="btnRight.btnBusinessSearch"
              @click="businessSearchShow"
            >业务查询
            </el-button
            >
            <el-button type="primary" @click="photoRecordShow"
            >人脸识别
            </el-button
            >
            <!--            <el-button type="success" icon="el-icon-plus" @click="fs1000A3tdOnLoding()">载入 </el-button>-->
            <!-- <textarea
              id="Console"
              style="height: 50px; width: 200px; resize: none"
              disabled="disabled"
            ></textarea> -->
          </el-row>
        </div>
        <div class="PageItem">
          <el-row class="PageInfo"><i class="info-bar"></i>逝者信息</el-row>

          <el-row class="paddingleft2em">
            <el-col :span="6">
               <el-form-item label="　业务编码">
                <el-input
                  v-model="ruleForm.funeralDead.businessCode"
                  :disabled="true"
                ></el-input>
              </el-form-item>
              <el-form-item label="　出生日期" prop="funeralDead.birthDate">
                <el-date-picker
                  type="date"
                  v-model="ruleForm.funeralDead.birthDate"
                  placeholder="选择日期"
                  class="w150"
                  :picker-options="pickerOptions"
                ></el-date-picker>
              </el-form-item>
              <el-form-item label="　民族">
              <el-select
                v-model="ruleForm.funeralDead.deadNationCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchnation"
                placeholder="请选择民族"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.nation"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="骨灰处理方式" class="lineheight">
              <el-select
                v-model="ruleForm.funeralDead.ashHandleTypeCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchtreatment_of_ashes"
                placeholder="请选择处理方式"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.ashes_treatment"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
            
            </el-col>
            <el-col :span="6">
              <el-form-item label="姓名" prop="funeralDead.deadName">
              <el-input
                v-model="ruleForm.funeralDead.deadName"
                minlength="2"
                maxlength="50"
                :title="ruleForm.funeralDead.deadName"
                placeholder="姓名"
              >
                <span
                  slot="append"
                  style="cursor: pointer"
                  @click="fs1000A3tdReadDeadIdCard('funeralDead')"
                  v-if="btnRight.btnReadDeadIdentityCard"
                >读取</span
                >
              </el-input>
            </el-form-item>
             <el-form-item label="　证件类型">
              <el-select
                v-model.number="ruleForm.funeralDead.certificateTypeCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchcertificates"
                placeholder="请选择证件类型"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.certificates"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
            <el-form-item
              label="　死亡日期"
              prop="funeralDead.deathDate"
              :rules="isrequired=='0'
              ?validDeathDate
              :[{required: false}]">
              <el-date-picker
                v-model="ruleForm.funeralDead.deathDate"
                type="date"
                placeholder="选择日期"
                class="w150"
                style="width: 100px"
                :picker-options="pickerOptions"
              ></el-date-picker>
            </el-form-item>
            <el-form-item label="　死亡原因">
              <el-select
                v-model="ruleForm.funeralDead.deathCause"
                allow-create
                :disabled="deathBoolean"
                ref="deathChange_ref"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchcause_of_death"
                placeholder="请选择或输入"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.cause_of_death"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataText"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
            </el-col>
            <el-col :span="6">
               <el-form-item label="　性别">
              <el-select
                v-model="ruleForm.funeralDead.deadGenderCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchsex"
                placeholder="请选择性别"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.sex"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
               </el-form-item>
              <el-form-item label="　证件号码">
                <el-input
                  v-model="ruleForm.funeralDead.certificateNo"
                  maxlength="20"
                  :title="ruleForm.name"
                  placeholder="请填写证件号码"
                ></el-input>
              </el-form-item>
              <el-form-item label="　逝者类型">
              <el-select
                @change="selectChanged"
                v-model="ruleForm.funeralDead.typeOfDeathCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchcremation_type"
                placeholder="请选择逝者类型"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.type_of_death"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="死亡证明编号" class="lineheight" id="deathCertificateNo">
              <el-input
                v-model="ruleForm.funeralDead.deathCertificateNo"
                maxlength="20"
                placeholder="请填写死亡证明编号"
                class="lineheight"
              ></el-input>
            </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　年龄">
              <el-input
                placeholder="请输入"
                v-model.number="ruleForm.funeralDead.deadAge"
                :disabled="agetype == ageWeizhiFlag ? true : false"
                @input="agelimit(ruleForm.funeralDead.deadAge)"
                class="input-with-select"
              >
                <el-select
                  v-model="agetype"
                  slot="prepend"
                  class="agewidth"
                  placeholder="请选择"
                  @change="age(agetype)"
                >
                  <el-option
                    v-for="item in copydictionary.age_type"
                    :key="item.dataCode"
                    :label="item.dataText"
                    :value="item.dataCode"
                    :disabled="item.disableState"
                  />
                </el-select>
              </el-input>
            </el-form-item>
            <el-form-item label="　国籍">
              <el-select
                v-model="ruleForm.funeralDead.countryCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchnationality"
                placeholder="请选择国籍"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.nationality"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="遗体状态" prop="funeralDead.remainsStateCode">
              <el-select
                v-model="ruleForm.funeralDead.remainsStateCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchremains_state"
                placeholder="请选择遗体状态"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.remains_state"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
            <el-form-item label="死亡证明出具单位" class="lineheight">
              <el-select
                v-model="ruleForm.funeralDead.deathCertificateUnit"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchnegotiator_user"
                placeholder="请选择或填写"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.funeral_certificate_unit"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataText"
                />
              </el-select>
            </el-form-item>
            </el-col>
          </el-row>
          <el-row class="paddingleft2em">
            <el-col :span="12">
              <el-form-item label="殡葬证明出具单位" class="lineheight" id="funeralCertificateUnit">
                <el-select
                  v-model="ruleForm.funeralDead.funeralCertificateUnit"
                  allow-create
                  @focus="focus"
                  @clear="clear"
                  @blur.native.capture="funeralCertificateUnit_blur"
                  @change="funeralCertificateUnit_change"
                  @visible-change="funeralCertificateUnit_visible_change"
                  clearable
                  filterable
                  :filter-method="PinyinMatch_burial_certificate_unit"
                  placeholder="请选择"
                >
                  <el-option
                    v-for="(item,index) in copydictionary.burial_certificate_unit"
                    :key="index"
                    :label="item.dataText"
                    :value="item.dataText"
                    :disabled="!!item.disableState"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="　省市区县" class="cascader" prop="funeralDead.provinceCityCountyFullName"
                          :rules="isrequired == '0'? provinceCityCountyRule: [{ required: false }]">
              <el-input
                v-model="ruleForm.funeralDead.provinceCityCountyFullName"
                v-show="!modify"
                @change="
                  cityCountyClear(
                    ruleForm.funeralDead.provinceCityCountyFullName
                  )
                "
                class="modify"
                :disabled="true"
              >
                <span
                  slot="append"
                  style="cursor: pointer"
                  @click="modifychange"
                  v-if="btnRight.btnReadDeadIdentityCard"
                >修改</span
                >
              </el-input>
             
              <el-cascader
                v-show="modify"
                allow-create
                filterable
                class="select"
                placeholder="请选择省/市/区县"
                ref="refHandle"
                :options="options"
                :props="{ checkStrictly: true, expandTrigger: 'hover' }"
                v-model="provinceCityCountyIds"
                clearable
                @change="handleChange"
              ></el-cascader>
               </el-form-item>
            </el-col>
          </el-row>
          <el-row class="paddingleft2em">
            <el-col :span="6">
              <el-form-item label="　街道办">
              <i class="streetwidth">
                <el-select
                  v-model="ruleForm.funeralDead.townId"
                  @change="loadvillage(0)"
                  clearable
                  filterable
                  @clear="street_clear"
                  @visible-change='streetlist = copyStreetlist'
                  :filter-method="street_filter"
                  placeholder="请选择街道办"
                >
                  <el-option
                    v-for="item in streetlist"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
                <!-- <el-button
                  slot="append"
                  icon="el-icon-search"
                  @click="street_search()"
                ></el-button> -->
              </i>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　行政村">
              <i class="streetwidth">
                <el-select
                  v-model="ruleForm.funeralDead.villageId"
                  @change="changeTown"
                  clearable
                  filterable
                  @visible-change='villagelist = copyVillagelist'
                  :filter-method="town_filter"
                  placeholder="请选择行政村"
                >
                  <el-option
                    v-for="item in villagelist"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
                <!-- <el-button
                  slot="append"
                  icon="el-icon-search"
                  @click="street_search()"
                ></el-button> -->
              </i>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　减免类型" prop="funeralDead.exemptionTypeCode">
              <el-select
                v-model="ruleForm.funeralDead.exemptionTypeCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchexemption_type"
                placeholder="请选择减免类型"
              >
                <el-option
                  v-for="item in copydictionary.exemption_type"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="是否本地户口" class="lineheight">
                <el-select
                  v-model="ruleForm.funeralDead.asLocal"
                  filterable
                  placeholder="请选择"
                  class="w150"
                >
                  <el-option
                    v-for="item in aslocal"
                    :key="item.value"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="paddingleft2em" >
            <el-col :span="12">
              <el-form-item label="　生前住址">
                <el-input
                  v-model="ruleForm.funeralDead.beforeDeathAddress"
                  maxlength="50"
                  class="w425"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="　户籍地">
              <el-input
                v-model="ruleForm.funeralDead.householdRegistrationPlace"
                class="w425"
                placeholder="请填写户籍地"
              ></el-input>
            </el-form-item>
            </el-col>
          </el-row>
          <!-- <el-row class="paddingleft2em">
           <el-col :span="12">
              <el-form-item label="　接尸地点">
                <el-input
                  v-model="ruleForm.funeralDead.transportPlace"
                  class="w425"
                  maxlength="50"
                  placeholder="请填写接尸地点"
                ></el-input>
              </el-form-item>
            </el-col> 
          </el-row>
          <el-row class="paddingleft2em">
            <el-col :span="6">
              <el-form-item label="是否外运">
              <el-select
                v-model="ruleForm.funeralDead.asOuterTransport"
                filterable
                placeholder="请选择"
                class="w150"
              >
                <el-option
                  v-for="item in yesorno"
                  :label="item.label"
                  :value="item.value"
                  :key="item.dataCode"
                />
              </el-select>
            </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item
              label="外运地址"
              v-if="ruleForm.funeralDead.asOuterTransport === 1"
              prop="funeralDead.outerTransportAddress"
            >
              <el-input
                v-model="ruleForm.funeralDead.outerTransportAddress"
                class="w425"
                maxlength="50"
                placeholder="请填写外运地址"
              ></el-input>
            </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　是否到馆">
              <el-select
                v-model="ruleForm.funeralDead.asArrived"
                filterable
                placeholder="请选择"
                @change="changeAsArrived"
                class="w150"
              >
                <el-option
                  v-for="item in yesorno"
                  :label="item.label"
                  :value="item.value"
                  :key="item.dataCode"
                />
              </el-select>
            </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
              label="到馆时间"
              v-if="ruleForm.funeralDead.asArrived == 1"
              prop="funeralDead.arrivedTime"
            >
              <el-date-picker
                type="datetime"
                placeholder="选择日期"
                format="yyyy-MM-dd HH:mm"
                v-model="ruleForm.funeralDead.arrivedTime"
                style="width: 10vw"
              ></el-date-picker>
            </el-form-item>
            </el-col>
          </el-row> -->
          <el-row class="paddingleft2em">
            <el-form-item label="　减免区域" style="display: none">
              <el-select
                v-model="ruleForm.funeralDead.benefitDistrictCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchhuimin_region"
                placeholder="请选择减免区域"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.huimin_region"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
          </el-row>
          <el-row class="paddingleft2em">
            <el-form-item label="　备注">
              <el-input
                type="textarea"
                v-model="ruleForm.funeralDead.remark"
                placeholder="请填写备注"
                class="w1230"
              ></el-input>
            </el-form-item>
          </el-row>
          <!-- <el-row class="paddingleft2em">
            <el-form-item label="　冷藏备注(只读)">
              <el-input
                type="textarea"
                v-model="ruleForm.coldPrintRemark"
                placeholder="只读"
                class="w1230"
                :readonly="true"
              ></el-input>
            </el-form-item>
          </el-row> -->
        </div>
        <div class="PageItem">
          <el-row class="PageInfo">
            <i class="info-bar"></i>逝者家属信息
          </el-row>
          <el-row class="paddingleft2em">
            <el-col :span="6">
              <el-form-item label="　姓名">
              <el-input
                v-model="ruleForm.familyMember.memberName"
                minlength="2"
                maxlength="50"
                placeholder="请填写姓名"
              >
                <span
                  slot="append"
                  style="cursor: pointer"
                  @click="fs1000A3tdReadDeadIdCard('familyMember')"
                  v-if="btnRight.btnReadFamilyMemberIdentityCard"
                >读取</span
                >
              </el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　性别">
              <el-select
                v-model="ruleForm.familyMember.memberGenderCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchsex"
                placeholder="性别"
              >
                <el-option
                  v-for="item in copydictionary.sex_simple"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　证件类型">
                <el-select
                  v-model="ruleForm.familyMember.certificateTypeCode"
                  @focus="focus"
                  @clear="clear"
                  clearable
                  filterable
                  :filter-method="PinyinMatchcertificates"
                  placeholder="请选择证件类型"
                  class="w150"
                >
                  <el-option
                    v-for="item in copydictionary.certificates"
                    :key="item.dataCode"
                    :label="item.dataText"
                    :value="item.dataCode"
                    :disabled="item.disableState"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　证件号码">
                <el-input
                  v-model="ruleForm.familyMember.certificateNo"
                  maxlength="20"
                  placeholder="请填写证件号码"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row class="paddingleft2em">
            <el-col :span="6">
              <el-form-item label="与逝者关系" class="lineheight letter2">
                <el-select
                  v-model="ruleForm.familyMember.memberRelation"
                  allow-create
                  @focus="focus"
                  @clear="clear"
                  clearable
                  filterable
                  :filter-method="PinyinMatchrelationship_with_deceased"
                  placeholder="请选择或输入"
                  class="w150"
                  @change="setAgentRelation"
                >
                  <el-option
                    v-for="item in copydictionary.relationship_with_deceased"
                    :key="item.dataCode"
                    :label="item.dataText"
                    :value="item.dataText"
                    :disabled="item.disableState"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　手机号码">
                <el-input
                  v-model="ruleForm.familyMember.mobilePhone"
                  onkeyup="value=value.replace(/[^\d]/g,'')"
                  maxlength="11"
                  placeholder="请填写手机号码"
                  @change="setFamilyAgentPhone"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　其他电话">
                <el-input
                  v-model="ruleForm.familyMember.otherPhone"
                  maxlength="50"
                  placeholder="请填写其他电话"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6"></el-col>
          </el-row>
          <el-row class="paddingleft2em">
            <el-form-item label="　联系地址">
              <el-input
                v-model="ruleForm.familyMember.address"
                maxlength="50"
                class="w1230"
                placeholder="请填写联系地址"
              ></el-input>
            </el-form-item>
          </el-row>
        </div>
        <div class="PageItem">
          <el-row class="PageInfo"><i class="info-bar"></i>承办人信息</el-row>
          <el-row class="paddingleft2em">
            <el-col :span="6">
              <el-form-item
              label="承办人类型"
              class="lineheight letter2"
              prop="familyAgent.agentType"
            >
              <el-select
                v-model="ruleForm.familyAgent.agentType"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchagent_type"
                placeholder="请选择承办人类型"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.agent_type"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
                label="　单位名称"
                v-if="ruleForm.familyAgent.agentType != 0"
              >
                <el-input
                  v-model="ruleForm.familyAgent.agentUnitName"
                  maxlength="50"
                  placeholder="请填写单位名称"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　姓名">
                <el-input
                  v-model="ruleForm.familyAgent.agentName"
                  minlength="2"
                  maxlength="50"
                  placeholder="请填写姓名"
                >
                  <span
                    slot="append"
                    style="cursor: pointer"
                    @click="fs1000A3tdReadDeadIdCard('familyAgent')"
                    v-if="btnRight.btnReadFamilyAgentIdentityCard"
                  >读取</span
                  >
                </el-input>
            </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　性别">
                <el-select
                  v-model="ruleForm.familyAgent.agentGenderCode"
                  @focus="focus"
                  @clear="clear"
                  clearable
                  filterable
                  :filter-method="PinyinMatchsex"
                  placeholder="请选择性别"
                  class="w150"
                >
                  <el-option
                    v-for="item in copydictionary.sex_simple"
                    :key="item.dataCode"
                    :label="item.dataText"
                    :value="item.dataCode"
                    :disabled="item.disableState"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span='6'>
              <el-form-item
              label="证件类型"
              prop="familyAgent.certificateTypeCode"
              :rules="
                isrequired == '0'
                  ? [
                      {
                        required: true,
                        message: '请选择承办证件类型',
                        trigger: 'change',
                      },
                    ]
                  : [{ required: false }]
              "
            >
              <el-select
                v-model="ruleForm.familyAgent.certificateTypeCode"
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchcertificates"
                placeholder="请选择证件类型"
                class="w150"
              >
                <el-option
                  v-for="item in copydictionary.certificates"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataCode"
                  :disabled="item.disableState"
                />
              </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
              label="证件号码"
              prop="familyAgent.certificateNo"
              :rules="
                isrequired == '0'
                  ? [
                      {
                        required: true,
                        message: '请输入承办证件号码',
                        trigger: 'change',
                      },
                    ]
                  : [{ required: false }]
              "
            >
              <el-input
                v-model="ruleForm.familyAgent.certificateNo"
                maxlength="20"
                placeholder="请填写证件号码"
              ></el-input>
            </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
              label="与逝者关系"
              prop="familyAgent.agentRelation"
              :rules="
                isrequired == '0'
                  ? [
                      {
                        required: true,
                        message: '请选择承办与逝者关系',
                        trigger: 'change',
                      },
                    ]
                  : [{ required: false }]
              "
              class="lineheight letter2"
            >
              <el-select
                v-model="ruleForm.familyAgent.agentRelation"
                allow-create
                @focus="focus"
                @clear="clear"
                clearable
                filterable
                :filter-method="PinyinMatchrelationship_with_deceased"
                placeholder="请选择或者输入"
              >
                <el-option
                  v-for="item in copydictionary.relationship_with_deceased"
                  :key="item.dataCode"
                  :label="item.dataText"
                  :value="item.dataText"
                  :disabled="item.disableState"
                />
              </el-select>
            </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item
              label="手机号码"
              prop="familyAgent.mobilePhone"
              :rules="
                isrequired == '0'
                  ? [
                      {
                        required: true,
                        message: '请输入承办手机号码',
                        trigger: 'blur',
                      },
                    ]
                  : [{ required: false }]
              "
            >
              <el-input
                v-model="ruleForm.familyAgent.mobilePhone"
                @mousewheel.native.prevent
                onkeyup="value=value.replace(/[^\d]/g,'')"
                maxlength="11"
                placeholder="请填写手机号码"
              ></el-input>
            </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="　其他电话">
              <el-input
                v-model="ruleForm.familyAgent.otherPhone"
                @mousewheel.native.prevent
                maxlength="50"
                placeholder="请填写其他电话"
              ></el-input>
            </el-form-item>
            </el-col>
          </el-row>
          <el-row class="paddingleft2em">
            <el-form-item label="　联系地址">
              <el-input
                v-model="ruleForm.familyAgent.address"
                maxlength="50"
                class="w1230"
                placeholder="请填写联系地址"
              ></el-input>
            </el-form-item>
          </el-row>
        </div>
        <div class="PageItem">
          <el-row class="PageInfo">
            <i class="info-bar"></i>服务费用
            <el-button
              type="primary"
              style="float: right"
              @click="newExpenses('add')"
            >新增费用
            </el-button
            >
          </el-row>
          <el-row class="PageInfo">
            <el-table :data="expensesTableData" border style="width: 100%" :height="300">
              <el-table-column prop="itemName" label="收费项目"></el-table-column>
              <el-table-column label="单价">
                <template slot-scope="scope">
                  <div>
                    <el-input v-model="scope.row.itemPrice"
                              @change="chargeItemPriceChange($event,scope.row.id)"></el-input>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="benefitCharge" label="优惠">
                <template slot-scope="scope">
                  <div>
                    <el-input v-model="scope.row.benefitCharge"
                              @change="chargeItemDiscountChange($event,scope.row.id)"></el-input>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="itemNumber" label="数量">
                <template slot-scope="scope">
                  <div>
                    <el-input v-model="scope.row.itemNumber"
                              @change="chargeItemNumberChange($event,scope.row.id)"></el-input>
                  </div>
                </template>
              </el-table-column>
              <el-table-column prop="itemUnit" label="单位"></el-table-column>
              <el-table-column label="操作">
                <template slot-scope="scope">
                  <el-button
                    type="danger"
                    @click="handleDeleteChargeItem(scope.row)">删除
                  </el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-row>
        </div>
        <el-dialog
          :title="expensesDialogTitle"
          :visible.sync="expensesDialogVisible"
          v-dialogDrag
          width="800px"
        >
          <!--Table 展开监听事件 @expand-change='expandColumn' -->
          <el-table
            ref="multipleTable"
            :data="expensesData"
            tooltip-effect="dark"
            border
            style="width: 100%"
            row-key="tableKey"
            lazy
            :load="loadExpensesChildren"
            :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
            @selection-change="handleSelectionChange"

          >
            <el-table-column type="selection" width="55" :selectable="selectable"></el-table-column>
            <el-table-column prop="itemName" label="收费项目"></el-table-column>
            <el-table-column prop="itemPrice" label="单价"></el-table-column>
            <el-table-column prop="itemNumber" label="数量"></el-table-column>
            <el-table-column prop="itemUnit" label="单位"></el-table-column>
            <el-table-column prop="benefitCharge" label="优惠"></el-table-column>
          </el-table>
          <div slot="footer" class="dialog-footer">
            <el-button @click="expensesDialogVisible=false">取 消</el-button>
            <el-button type="primary" @click="SaveExpense">确 定</el-button>
          </div>
        </el-dialog>
        <el-row
          class="PageItem"
          :gutter="30"
          style="text-align: right; margin: 30px 0"
        >
          <el-button
            type="primary"
            @click="checkCertificateNo()"
            v-if="btnRight.btnSaveFuneralBusiness"
            
          >保存
          </el-button>
          <el-button
            type="primary"
            @click="SaveAndService()"
            v-if="btnRight.btnSaveJumpServiceNegotiation"
            
          >保存并打印火化证
          </el-button>
          <el-button
            type="primary"
            plain
            @click="PhotoArchival()"
            v-if="btnRight.btnPhotoArchival && photoBtnlimt && !new_photolimit"
          >拍照备案
          </el-button>
          <el-button
            type="primary"
            plain
            @click="Print()"
            v-if="btnRight.btnPrintQRCode && photoBtnlimt && !new_photolimit"
          >打印逝者二维码
          </el-button>
        </el-row>
      </el-form>
    </div>
    <div style="width: 0px; height: 0px; overflow: hidden">
      <object id="view1" type="application/x-eloamplugin" name="view"></object>
    </div>
    <div id="idCardContainer"></div>
    <SearchDialog
      :DialogSearch="DialogSearch"
      :copyCremationTypes="dictionary.cremation_type"
    ></SearchDialog>
    <PhotoRecordDialog
      :DialogPhotoRecord="DialogPhotoRecord"
      :businessCode="businessCode"
    ></PhotoRecordDialog>
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%"
      :before-close="handleClose">
      <span>此逝者证件号已存在是否进行保存</span>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取消保存</el-button>
    <el-button type="primary" @click="Save()">确认保存</el-button>
  </span>
    </el-dialog>
  </div>
</template>

<script>
  import * as Type from "@/api/service";
  import * as API from '@/api/systemApplication'
  import {treeTransformate} from "../../utils/treeTransformate";
  import {dataFormate, dataFormatetmd, dataFormatetmd1} from "@/utils/index";
  import SearchDialog from "../dialog/SearchDialog";
  // import {provinceCityCounty} from '@/utils/provinceCityCounty'
  // import GPY_S620A3XR from '@/api/GPY_S620A3XR'
  import IdCard from "@/api/IdCard_SS628_100_001U";
  // import  fsPerson   from '@/api/FS1000A3TDPersonCard'
  import fsIdCard from "@/api/FS1000A3TDIdCard"; //慧影多浏览器引入脚本
  import PhotoRecordDialog from "../dialog/PhotoRecordDialog";
  import {getLodop} from "@/utils/lodopFuncs";
  import {getUserInfo} from "@/utils/auth";
  import {EventBus} from '@/utils/eventBus'

  export default {
    name: "home",
    props: {
      //自定义模板清除属性
      clearable: {
        type: Boolean,
        default: true,
      },
    },
    components: {
      PhotoRecordDialog,
      SearchDialog,
    },
    data() {
      var deathDate = (rule, value, callback) => {
        //死亡日期和出生日期对比
        let data1 = new Date(value);
        let data2 = new Date(this.ruleForm.funeralDead.birthDate);
        if (data2 != null && this.isValidDate(data2)) {
          if (this.ruleForm.funeralDead.birthDate) {
            if (data1.getTime() > data2.getTime()) {
              this.getAge();
              callback();
            } else if (data1.getTime() === data2.getTime()) {
              this.getAge();
              callback();
            } else {
              callback(new Error("死亡日期不可以早于出生日期"));
            }
          } else {
            callback();
          }
        } else {
          callback();
        }
      };

      var birthDate = (rule, value, callback) => {
        // console.log(value + "出生日期");
        //出生日期和死亡日期对比
        let data1 = new Date(value);
        //  console.log(this.isValidDate(data1) + "出生日期data1");
        let data2 = new Date(this.ruleForm.funeralDead.deathDate);
        //  console.log(data2 + "出生日期data2");
        if (value != null && this.isValidDate(data1)) {
          if (this.ruleForm.funeralDead.deathDate) {
            if (data1.getTime() > data2.getTime()) {
              callback(new Error("出生日期不可以晚于死亡日期"));
            } else if (data1.getTime() === data2.getTime()) {
              this.getAge();
              callback();
            } else {
              console.log("计算年龄");
              this.getAge();
              callback();
            }
          }
        } else {
          callback();
        }
      };
      //校验省市区县四个值均存在
      var checkProvinceCityCounty = (rule, value, callback) => {
        let values = value.split('/');
        let area = values[values.length - 1]
        if (this.dicOptions[area]) {
          callback();
        } else {
          return callback(new Error('请输入省市区县'));
        }
      };
      const _self = this;
      return {
        expensesDialogVisible: false,//选择费用弹框
        expensesDialogTitle: '新增',
        expensesData: [],//服务项目
        expensesChildrenData: [],//子集服务项目
        multipleSelection: [], //多选数据
        tmpFuneralDead_FuneralCertificateUnit: '',
        dicOptions: {},
        validDeathDate: [{required: true, message: '请输入死亡日期', trigger: 'change'}, {
          validator: deathDate,
          trigger: 'change',
        },],
        isFirstLoad: true,
        provinceCityCountyIds: [1350, 57585],
        //省市区县的校验规则
        provinceCityCountyRule: [
          {
            required: true,
            message: '请选择省市区县',
            trigger: 'change',
          },
          {
            validator: checkProvinceCityCounty,
            trigger: 'change',
          },
        ],
        serviceRoute: "",
        dialogVisible: false,
        orginssq: [1350, 57585],
        rules: {required: false},
        isrequired: 0,
        loading: false,
        isEdit: false,
        btnPermisson: {}, //输入业务编码
        aslocal: [
          {
            label: "外地户口",
            value: 0,
          },
          {
            label: "本地户口",
            value: 1,
          },
        ],
        yesorno: [
          {
            label: "否",
            value: 0,
          },
          {
            label: "是",
            value: 1,
          },
        ],
        deathBoolean: false,
        ruleForm: {
          funeralDead: {
            deadName: "",
            id: "",
            businessCode: "",
            exemptionTypeCode: "",
            deadGenderCode: "",
            memberName: "",
            certificateTypeCode: "",
            certificateNo: "",
            countryCode: "",
            deadNationCode: "",
            memberGenderCode: "",
            deadAge: "",
            deadAgeTypeCode: "",
            birthDate: "",
            cremationTypeCode: "",
            remainsStateCode: "",
            deathDate: "",
            deathCause: "",
            ashHandleTypeCode: "",
            provinceId: "",
            cityId: "",
            countyId: "",
            provinceCityCountyId: "",
            provinceCityCountyFullName: "",
            townId: "",
            villageId: "",
            beforeDeathAddress: "",
            asLocal: 1,
            householdRegistrationClassCode: "",
            householdRegistrationPlace: "",
            deathCertificateUnit: "",
            funeralCertificateUnit: "",
            asOutwardTransport: "",
            outwardTransportTime: "",
            outwardTransportPlace: "",
            benefitDistrictCode: "",
            remark: "",
            transportWayCode: "",
            transportPlace: "",
            asArrived: "",
            //是否外运
            asOuterTransport: "",
            //外运地址
            outerTransportAddress: "",
            //是否馆外司机
            asOutsideDriver: "",
            //司机id
            driverUserIdr: "",
            transportArrivedTime: "",
            arrivedTime: "",
          },
          familyMember: {
            id: "",
            businessCode: "",
            remainsStateCode: "",
            memberName: "",
            memberGenderCode: "",
            memberAge: "",
            telephone: "",
            address: "",
            certificateTypeCode: "",
            certificateNo: "",
            memberRelation: "",
          },
          familyAgent: {
            id: "",
            businessCode: "",
            agentType: "",
            agentUnitName: "",
            mobilePhone: "",
            agentName: "",
            agentGenderCode: "",
            agentAge: "",
            telephone: "",
            address: "",
            certificateTypeCode: "",
            certificateNo: "",
            agentRelation: "",
          },
          chargeAllItems: [],
          //冷藏业务主键
          coldStorageId: 0,
          //冷藏打印备注
          coldPrintRemark: ""
        }, //按钮权限
        btnRight: {
          btnBusinessCodeScanning: false,
          btnAddFuneralBusiness: false,
          btnReadDeadIdentityCard: false,
          btnReadFamilyMemberIdentityCard: false,
          btnReadFamilyAgentIdentityCard: false,
          btnSaveFuneralBusiness: false,
          btnSaveJumpServiceNegotiation: false,
          btnPhotoArchival: false,
          btnPrintQRCode: false,
          btnBusinessSearch: false, //业务查询
        }, //业务编码
        businessCode: "",
        businessCodeTitle: "",
        copyruleForm: {
          funeralDead: {
            deadName: "",
            id: "",
            businessCode: "",
            exemptionTypeCode: "",
            deadGenderCode: "",
            memberName: "",
            certificateTypeCode: "",
            certificateNo: "",
            countryCode: "",
            deadNationCode: "",
            memberGenderCode: "",
            deadAge: "",
            birthDate: "",
            cremationTypeCode: "",
            remainsStateCode: "",
            deathDate: "",
            deathCause: "",
            ashHandleTypeCode: "",
            provinceId: "",
            cityId: "",
            countyId: "",
            provinceCityCountyId: 57585,
            provinceCityCountyFullName: "山东省/临沂市",
            townId: "",
            villageId: "",
            beforeDeathAddress: "",
            asLocal: 1, //默认加载本地数据
            householdRegistrationClassCode: "",
            householdRegistrationPlace: "",
            deathCertificateUnit: "",
            funeralCertificateUnit: "",
            asOutwardTransport: "",
            outwardTransportTime: "",
            outwardTransportPlace: "",
            benefitDistrictCode: "",
            remark: "",
            transportWayCode: "",
            transportPlace: "",
            asArrived: "",
            transportArrivedTime: "",
            arrivedTime: "",
          },
          familyMember: {
            id: "",
            businessCode: "",
            remainsStateCode: "",
            memberName: "",
            memberGenderCode: "",
            memberAge: "",
            telephone: "",
            address: "",
            certificateTypeCode: "",
            certificateNo: "",
            memberRelation: "",
          },
          familyAgent: {
            id: "",
            businessCode: "",
            agentType: "",
            agentUnitName: "",
            mobilePhone: "",
            agentName: "",
            agentGenderCode: "",
            agentAge: "",
            telephone: "",
            address: "",
            certificateTypeCode: "",
            certificateNo: "",
            agentRelation: "",
          },
          chargeAllItems:[]
        },
        DialogSearch: false, //业务查询
        DialogPhotoRecord: false, //人脸识别
        rules: {
          "funeralDead.deadName": [
            {
              required: true,
              message: "请输入逝者姓名",
              trigger: "blur",
            },
            {
              min: 1,
              max: 50,
              message: "长度在 1 到 50 个字符",
              trigger: "blur",
            },
          ],
          "familyMember.memberName": [
            {
              required: true,
              message: "请输入家属姓名",
              trigger: "blur",
            },
            {
              min: 1,
              max: 50,
              message: "长度在 1 到 50 个字符",
              trigger: "blur",
            },
          ],
          "familyAgent.agentType": [
            {
              required: true,
              message: "请选择承办人类型",
              trigger: "change",
            },
          ],
          "funeralDead.certificateTypeCode": [
            {
              required: true,
              message: "请选择逝者证件类型",
              trigger: "change",
            },
          ],
          "funeralDead.deadGenderCode": [
            {
              required: true,
              message: "请选择逝者性别",
              trigger: "change",
            },
          ],
          "funeralDead.deadAge": [
            {
              required: true,
              message: "请输入逝者年龄",
              trigger: "change",
            },
          ],
          "funeralDead.certificateNo": [
            {
              required: true,
              message: "请输入逝者证件号码",
              trigger: "blur",
            },
          ],
          "funeralDead.countryCode": [
            {
              required: true,
              message: "请输入逝者国籍",
              trigger: "change",
            },
          ],
          "funeralDead.deadNationCode": [
            {
              required: true,
              message: "请选择逝者民族",
              trigger: "change",
            },
          ],
          "funeralDead.deathDate": [
            {
              required: true,
              message: "请输入死亡日期",
              trigger: "blur",
            },
            {
              validator: deathDate,
              trigger: "blur",
            },
          ],
          "funeralDead.remainsStateCode": [
            {
              required: true,
              message: "请选择遗体状态",
              trigger: "change",
            },
          ],
          "funeralDead.deathCause": [
            {
              required: true,
              message: "请选择死亡原因",
              trigger: "change",
            },
          ],
          "funeralDead.arrivedTime": [
            {
              required: true,
              message: "请选择时间",
              trigger: "blur",
            },
          ],
          "familyMember.memberName": [
            {
              required: true,
              message: "请输入家属姓名",
              trigger: "blur",
            },
          ],
          "familyMember.memberGenderCode": [
            {
              required: true,
              message: "请选择家属性别",
              trigger: "change",
            },
          ],
          "familyMember.certificateTypeCode": [
            {
              required: true,
              message: "请选择家属证件类型",
              trigger: "change",
            },
          ],
          "familyMember.certificateNo": [
            {
              required: true,
              message: "请输入家属证件号码",
              trigger: "blur",
            },
          ],
          "familyMember.memberRelation": [
            {
              required: true,
              message: "请选择家属与逝者关系",
              trigger: "change",
            },
          ],
          "familyMember.mobilePhone": [
            {
              required: true,
              message: "请输入家属手机号码",
              trigger: "blur",
            },
          ],

          "funeralDead.birthDate": [
            {
              validator: birthDate,
              trigger: "blur",
            },
          ],
        },
        pickerOptions: {
          disabledDate(time) {
            return time.getTime() >= Date.now();
          },
        },
        dictionary: {}, //字典
        copydictionary: {}, //用于检索拼音
        negotiator_user: [], //洽谈员单独读取
        driverUsers: [], //司机
        copyDriverUsers: [], //司机
        selectedOptions: [],
        modify: true, //新增时为true
        new_photolimit: false, //新增时为true
        streetlist: [], //街道列表
        copyStreetlist: [], //复制街道列表
        villagelist: [], //村列表
        copyVillagelist: [],//拷贝数组
        saveFlag: false, //保存过程中不可更改,true为正在保存
        //省市区县数据
        options: [],
        option: [],
        agetype: 1, //年龄类型
        ageWeizhiFlag: 0,
        cremationType: 0, //遗体类型
        photoBtnlimt: false, //初次保存前，“拍照备案”和“打印逝者二维码”按钮禁用
        onpresscTime: 0, //  阻止短时间内连续点击
        timeint: null,
        staProps: {
          label: "label",
          value: "value",
          lazy: true, //设置lazyLoad，必须配合lazy：true
          checkStrictly: true,
          expandTrigger: "hover",
          async lazyLoad(node, resolve) {
            // 区域树懒加载的方法
            const {data} = node;
            if (data && data.children && data.children.length !== 0) {
              return resolve([]);
            }
            let id;
            if (data) {
              id = data.value;
              let temp;
              await _self.getSta(id).then((res) => {
                if (res) temp = res;
                for (const item of temp) {
                  item.children = [];
                }
                resolve(temp);
              });
            }
          },
        },

      };
    },
    created() {
      //读取路由传过来的参数,优先启用参数传过来的
      let code = this.$route.params.businessCodeParam;
      if (code != null) {
        this.businessCode = code;
        this.ReadData();
      } else if (this.$store.getters.businessCode) {
        this.businessCode = this.$store.getters.businessCode;
        this.ReadData();
      }
    },
    mounted() {
      //到馆时间默认当前时间 (因客户需求暂时去掉)
      // this.ruleForm.funeralDead.arrivedTime = new Date();
      //按钮权限
      this.btnRight = this.$route.meta.buttons;
      //遍历属性赋值将true与false字符串转换成布尔型的值
      for (var key of Object.keys(this.btnRight)) {
        this.btnRight[key] =
          this.btnRight[key] || this.btnRight[key] == "true" ? true : false;
      }
      //加载洽谈员
      //this.loaduserwithtypecode();
      //加载司机
      //this.loadDriverUsers();
      // 初始化高拍仪设备
      //GPY_S620A3XR.camera.load();
      //慧影高拍仪
      this.fs1000A3tdOnLoding();
      //加载数据字典
      //没有数据，加载数据
      this.$store
        .dispatch("user/getdictionary")
        .then((res) => {
          //获取字典数据
          this.dictionary = res;
          this.copydictionary = JSON.parse(JSON.stringify(this.dictionary));
          // console.log('copydictionary',res)
          // // burial_certificate_unit
          console.log('首页字典', res, this.dictionary)
          // console.log(this.copydictionary.type_of_death, "死者类型")
          this.$set(this.dictionary, res);
          //获取未知的code
          if (
            this.copydictionary.age_type &&
            this.copydictionary.age_type.length
          ) {
            this.copydictionary.age_type.forEach((item) => {
              if (item.dataText == "未知") {
                this.ageWeizhiFlag = item.dataCode;
              }
            });
          }
          /*判断遗体类型*/
          if (
            this.copydictionary.cremation_type &&
            this.copydictionary.cremation_type.length
          ) {
            this.copydictionary.cremation_type.forEach((item) => {
              if (item.dataText.indexOf("遗体") > -1) {
                this.cremationType = item.dataCode;
              }
            });
          }
          this.defaultValue();
        })
        .catch(() => console.log("promise catch err"));
      //加载省市区县数据
      this.loadprovince();
      this.handleChange(this.orginssq);

      //点击文本就让它自动点击前面的input就可以触发选择。但是因组件阻止了冒泡，暂时想不到好方法来触发。
      //这种比较耗性能，暂时想不到其他的，能实现效果了。
      this.timeint = setInterval(function () {
        var arry = document.querySelectorAll(".el-cascader-node__label");
        for (var n = 0; n < arry.length; n++) {
          var item = arry[n];
          item.onclick = function () {
            if (this.previousElementSibling) this.previousElementSibling.click();
          };
        }
      }, 1000);
      // 新语法hook代码更简洁，相当于下面   beforeDestroy  的逻辑
      this.$once("hook:beforeDestroy", () => {
        if (this.timeint) {
          console.log("清除定时器");
          clearInterval(this.timeint);
        }
      });
    },
    updated() {
      //清除校验
      if (this.isFirstLoad) {
        this.$refs.homeRuleForm.clearValidate();
        this.isFirstLoad = false
      }
      //初始化省市区县字典
      this.initDic()
    },
    computed: {

      //计算
      showsClear() {
        return (
          this.clearable && this.ruleForm.funeralDead.deathCause && this.isHover
        );
      },
      expensesTableData() {
        return this.ruleForm.chargeAllItems
      }
    },
    /*  beforeDestroy() {
            // GPY_S620A3XR.camera.unload();
            if (this.timeint) {
              console.log('清除定时器')
              clearInterval(this.timeint);
            }
          },*/
    methods: {

      //设置是否选中
      selectable(row, index) {
        // {
        //   "id": 101,
        //   "version": 1606379447,
        //   "itemName": "ooo",
        //   "itemNameAbbr": null,
        //   "itemPrice": 998.00,
        //   "benefitCharge": 123.00,
        //   "itemNumber": 1.00,
        //   "itemUnit": "次",
        //   "itemDescribe": "",
        //   "asPackage": 1,
        //   "sort": 0,
        //   "remark": "",
        //   "modifiedUserId": 1,
        //   "costItems": [{
        //   "id": 92,
        //   "cipId": 351,
        //   "itemName": "c",
        //   "itemNameAbbr": null,
        //   "itemPrice": 20.00,
        //   "benefitCharge": 0.00,
        //   "itemNumber": 12.00,
        //   "itemUnit": "次",
        //   "itemDescribe": "",
        //   "asPackage": 0,
        //   "sort": 0,
        //   "remark": "",
        //   "modifiedUserId": 1,
        //   "version": 1606379427
        // }, {
        //   "id": 93,
        //   "cipId": 363,
        //   "itemName": "火化111",
        //   "itemNameAbbr": null,
        //   "itemPrice": 20.00,
        //   "benefitCharge": 0.00,
        //   "itemNumber": 14.00,
        //   "itemUnit": "次",
        //   "itemDescribe": "",
        //   "asPackage": 0,
        //   "sort": 0,
        //   "remark": "",
        //   "modifiedUserId": 1,
        //   "version": 1606440171
        // }]
        // }]

        if (row.hasOwnProperty("cipId")) {
          return 0;
        } else {
          return 1;
        }
      },
      //打开-增服务费用-弹出框
      newExpenses(express, data) {
        if (express === "add") {
          //this.expensesDialogTitle = "费用新增";
          let postData = {}
          API['loadGoodsServiceTypeList'](postData).then(response => {
            const {data} = response;
            if (!data) {
              this.$message('数据读取失败')
              return
            }
            console.log('树', data)
            data.forEach(item => {
              //包的情况
              item.tableKey = 1000000 * Math.random()
              if (item.asPackage == 1) {
                item.hasChildren = true;
              }
            })
            this.expensesData = data

          }).catch(error => {
            this.$message(error)
          })
        } else {
          //this.expensesDialogTitle = "费用修改";
          //this.form = JSON.parse(JSON.stringify(data));
        }
        this.expensesDialogVisible = true;
      },
      //懒加载费用包子集
      async loadExpensesChildren(row, treeNode, resolve) {
        row.costItems.forEach(item => {
          item.tableKey = 1000000 * Math.random();
          console.log(item, '111')
        })
        resolve(row.costItems)
      },
      //新增服务费用-保存到本地列表
      SaveExpense() {
        let arr = []
        if (this.expensesDialogTitle === "新增") {
          let newArr = []
          let selectMap = new Map();
          //费用选项弹出框内容
          this.multipleSelection.forEach(item => {
            item.serviceItemId = item.id
            if (item.costItems.length > 0) {
              item.costItems.forEach(child => {
                child.serviceItemId = child.id
                var obj = selectMap.get(child.id)
                if (obj) {
                  obj.itemNumber = parseInt(obj.itemNumber) + parseInt(child.itemNumber)
                  selectMap.set(child.id, obj)
                } else {
                  selectMap.set(child.id, child)
                }
                // newArr.push(child)
              })
            } else {
              // newArr.push(item)
              var obj = selectMap.get(item.id)
              if (obj) {
                obj.itemNumber = parseInt(obj.itemNumber) + parseInt(item.itemNumber)
                selectMap.set(item.id, obj)
              } else {
                selectMap.set(item.id, item)
              }
            }
          })
          //获取选择项的所有内容
          console.log("弹出框选择", selectMap)
          //如果没有历史数据
          if (this.ruleForm.chargeAllItems.length == 0) {
            selectMap.forEach(function (value, key) {
              // console.log(key + " = " + value);
              newArr.push(value)
            })
            this.ruleForm.chargeAllItems = newArr
          } else {
            let have = []
            let no = []
            this.ruleForm.chargeAllItems.forEach(child => {
              if (selectMap.get(child.serviceItemId)) {
                have.push(child)
              } else {
                no.push(child)
              }
            })

            have.forEach(h => {
              h.itemNumber = parseInt(h.itemNumber) + parseInt(selectMap.get(h.serviceItemId).itemNumber)
              selectMap.delete(h.serviceItemId)
            })

            let noOfMap = []

            selectMap.forEach(function (value, key) {
              console.log(key + " = " + value);
              noOfMap.push(value)
            })
            console.log(have.length,no.length,noOfMap.length)

            let arr = have.concat(no).concat(noOfMap)

            this.ruleForm.chargeAllItems = arr;
          }
          console.log("",this.ruleForm.chargeAllItems,arr)
          this.expensesDialogVisible = false;
        } else {
         
        }
        //console.log('修改后',this.ruleForm.chargeAllItems)
      },
      //展开父级服务项
      expandColumn(e) {
        this.loadGoodsServiceListWithTypeData(e.id)
      },
      //根据父级加载物品，服务类型详情
      loadGoodsServiceListWithTypeData(id) {
        let postData = {
          "serviceTypeId": id,
        }
        API['loadGoodsServiceListWithType'](postData).then(response => {
          const {data} = response;
          console.log('根据父级', data)
          this.expensesChildrenData = data.list
          //this.
          // this.expensesData.map(item=>{
          //   if(item.id==id){
          //     item.children=data.list
          //   }
          // })
          // console.log("编辑",this.expensesData)
          //this.tableData = data.list;
          // this.pager = data.pager
        }).catch(error => {
          this.$message(error)
        })
      },
      //选则服务项目
      handleSelectionChange(val) {
        console.log(val,this.multipleSelection)
        this.multipleSelection = val;
        // val.forEach(item=>{
        //   this.multipleSelection.forEach(item1=>{
        //     if(item.id==item1.id){
        //       item.itemNumber+=item.itemNumber
        //     }
        //   })
        // })
        // console.log(this.multipleSelection,"88 ")
      },
      rowSelectChange(val) {
        console.log('', val)
      },
      //收费项目价格修改
      chargeItemPriceChange(e, row) {
        console.log(e, row)
      },
      //收费项目优惠修改
      chargeItemDiscountChange() {

      },
      //收费项目优惠修改
      chargeItemNumberChange() {

      },
      //删除服务费用项
      handleDeleteChargeItem(row) {
        console.log('删除', row)
        this.$confirm('删除信息, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.ruleForm.chargeAllItems = this.ruleForm.chargeAllItems.filter(item => item.id != row.id)
          console.log("删除后", this.ruleForm.chargeAllItems.filter(item => item.id != row.id))
        }).catch(() => {
          //几点取消的提示
        });
      },
      //载入火化证信息
      loadCremationCertificate() {
        //查询火化证接口数据
        let this_print = this;
        let postData = {
          "businessCode": this_print.businessCode
        }
        Type['loadPrintCremationCertificate'](postData).then(response => {
          //接收返回数据
          console.log('火化证',response.data)
          //调用打印接口
          this_print.printCremationCertificate(response.data);

        })
      },
      //打印火化证
      printCremationCertificate(printData) {
        let this_print = this;
        let LODOP = getLodop();
        if (LODOP == null || !LODOP) {
          this_print.$.messager.alert('系统提示', '您的浏览器不支持打印控件，请用IE重试或安装打印控件后重试');
          return;
        }
        console.log(printData, 999)


        for (let key in printData) {
          printData[key] = printData[key]
            ? printData[key]
            : "　";
        }
        //当前业务时间
        let businessCode = printData.businessCode;
        //火化证号
        let cremationNo = printData.cremationNo;
        //业务编码
        //let  firstParty="<h1>火　　化　　证　　明</h1>";
        //逝者姓名
        let deadName = printData.deadName;
        //逝者性别
        let deadGender = printData.deadGender;
        //逝者年龄
        let deadAge = "年龄：" + printData.deadAge;
        //户口所在地
        //证件类型
        let certificateTypeCode = printData.certificateType;
        //逝者证件号码
        let certificateNo = printData.certificateNo;
        //火化时间
        let appointmentDate = printData.appointmentDate;

        //领证人
        let thisMemberName = printData.memberName;

        //生前住址
        let beforeDeathAddress = printData.beforeDeathAddress;
        let dataTable = "　　逝者姓名: " + deadName + ",　 性别:　" + deadGender + "  ," + deadAge + ",　 身份证类型:" + certificateTypeCode +
          ",证件号码:　" + certificateNo + ",　逝者编号:　" + businessCode +
          ",生前地址: " + beforeDeathAddress + ", 已于" + appointmentDate + "日在本单位火化。 ";

        let butoom1 = "发证单位(盖章):";
        let jingBan = "经办人(签字):";
        let party = "临沂市殡仪馆";
        let gaizhang = "（火化专用章）";
        let date = dataFormatetmd1(new Date());
        let tel = "　　 　发证单位电话:0536-5651654";
        //纸张
        //LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "A4");
        //设置字体
        //LODOP.ADD_PRINT_TEXT(50,220,650,25, "火化证明");
        

        //打印标题
        //LODOP.ADD_PRINT_HTM(50,220,650,25,firstParty);
        LODOP.PRINT_INITA("0mm", "0mm", "68.8mm", "38.6mm", "二维条形码打印");
        LODOP.ADD_PRINT_BARCODE(
          "3.4mm",
          "2.4mm",
          "29.9mm",
          "29.9mm",
          "QRCode",
          businessCode
        );
        LODOP.SET_PRINT_STYLEA(0, "QRCodeVersion", 2);
        LODOP.SET_PRINT_STYLEA(0, "DataCharset", "UTF-8");
        LODOP.SET_PRINT_STYLE("FontSize", 12);
        //调用打印控件进行测试
        LODOP.ADD_PRINT_TEXT(140, 250, 650, 28, "证明编号：" + cremationNo);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 14);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "黑体");
        //打印协议
        LODOP.ADD_PRINT_TEXT(170, 50, 580, 200, dataTable);
        // LODOP.ADD_PRINT_TEXT("\r\n");
        LODOP.ADD_PRINT_TEXT(260, 72, 250, 60, "  特此证明。");
        LODOP.ADD_PRINT_TEXT(280, 30, 300, 60, "  领证人: " + thisMemberName);
        //发证单位
        LODOP.ADD_PRINT_TEXT(300, 470, 650, 50, party);
        //经办人
        LODOP.ADD_PRINT_TEXT(328, 462, 650, 50, gaizhang);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 10);
        LODOP.ADD_PRINT_TEXT(370, 460, 650, 50, date);
        LODOP.ADD_PRINT_TEXT(390, 375, 650, 50, tel);
        // LODOP.ADD_PRINT_TEXT(425,500,650,50,date);
        // LODOP.ADD_PRINT_TEXT(445,380,650,50,tel);


        //打印边框
        //LODOP.ADD_PRINT_RECT(60,55,500,300,0,1);
        // LODOP.ADD_PRINT_TABLE(115,50,300,300,tableStr);
        //直接打印
        //打印预览
        LODOP.PREVIEW();
        //LODOP.PRINT();
        //LODOP.PRINT_DESIGN();
      },
      //殡葬证明出具单位下拉框显隐事件
      funeralCertificateUnit_visible_change() {
        let tmpVal = this.ruleForm.funeralDead.funeralCertificateUnit
        this.ruleForm.funeralDead.funeralCertificateUnit = ""
        this.$nextTick(function () {
          this.ruleForm.funeralDead.funeralCertificateUnit = tmpVal
        });
      },
      //殡葬证明出具单位失焦事件
      funeralCertificateUnit_blur() {
        //说明刚刚输入的
        if (this.tmpFuneralDead_FuneralCertificateUnit) {
          this.ruleForm.funeralDead.funeralCertificateUnit = this.tmpFuneralDead_FuneralCertificateUnit
        }
      },
      // 殡葬证明出具单位选中事件
      funeralCertificateUnit_change() {
        this.tmpFuneralDead_FuneralCertificateUnit = ""
      },
      //初始化字典
      initDic() {
        let tmpObj = {}
        let options = this.options

        for (let i = 0; i < options.length; i++) {
          if (options[i].children.length) {
            let childs1 = options[i].children
            for (let j = 0; j < childs1.length; j++) {
              if (childs1[j].children.length) {
                let childs2 = childs1[j].children
                for (let k = 0; k < childs2.length; k++) {
                  tmpObj[childs2[k].label] = 1
                }
              } else {
                tmpObj[childs1[j].label] = 1
              }
            }
          } else {
            tmpObj[options[i].label] = 1
          }
        }
        console.log("")
        this.dicOptions = tmpObj
      },
      //编号转数字
      numToWord(val, array) {//val转label,存储数组
        let label = ''
        let tmpObj = {}
        for (let i = 0; i < array.length; i++) {
          tmpObj[array[i].value] = array[i].label
        }
        label = tmpObj[val]
        return label
      },
      //当省市区县,街道办及行政村均存在值的时候触发该方法,自动补充户籍地
      fillResidence() {
        this.ruleForm.funeralDead.householdRegistrationPlace = ''
        // if (this.ruleForm.funeralDead.provinceCityCountyFullName && this.ruleForm.funeralDead.villageId && this.ruleForm.funeralDead.townId) {
        let str = ''
        let ssqxs = this.ruleForm.funeralDead.provinceCityCountyFullName.split('/')
        let ssqx_len = ssqxs.length
        for (let i = 0; i < ssqx_len; i++) {
          str += ssqxs[i]
        }
        str += this.numToWord(this.ruleForm.funeralDead.townId, this.copyStreetlist) ? this.numToWord(this.ruleForm.funeralDead.townId, this.copyStreetlist) : ''
        str += this.numToWord(this.ruleForm.funeralDead.villageId, this.copyVillagelist) ? this.numToWord(this.ruleForm.funeralDead.villageId, this.copyVillagelist) : ''
        this.ruleForm.funeralDead.householdRegistrationPlace = str
        // }
      },
      //如果用户输入家属关系，承办人家属关系不为空则进行赋值
      setAgentRelation() {
        if (this.ruleForm.familyAgent.agentRelation === null || this.ruleForm.familyAgent.agentRelation === "") {
          this.ruleForm.familyAgent.agentRelation = this.ruleForm.familyMember.memberRelation;
        }
      },
      //如果用户输入家属手机号，承办人手机号不为空则进行赋值
      setFamilyAgentPhone() {
        if (this.ruleForm.familyAgent.mobilePhone === null || this.ruleForm.familyAgent.mobilePhone === "") {
          this.ruleForm.familyAgent.mobilePhone = this.ruleForm.familyMember.mobilePhone;
        }
      },
      handleClose(done) {
        this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {
          });
      },
      resetDefaultCode() {
        // 设置默认值
        this.ruleForm.funeralDead.provinceCityCountyId = 57585;
        this.ruleForm.funeralDead.provinceCityCountyFullName = "山东省/临沂市";
        this.loadstreet();
      },

      getAge() {
        console.log("计算年龄");
        let d = new Date(this.ruleForm.funeralDead.birthDate);
        if (d == null) return false;
        let Y = new Date(this.ruleForm.funeralDead.deathDate);
        if (Y == null) return false;

        let birthYear = d.getFullYear();
        let birthMonth = d.getMonth() + 1;
        let birthDay = d.getDate();

        let deathYear = Y.getFullYear();
        let deathMonth = Y.getMonth() + 1;
        let deathDay = Y.getDate();

        let returnAge;

        if (deathYear == birthYear) {
          returnAge = 0;//同年 则为0岁
        }
        else {
          let ageDiff = deathYear - birthYear; //年之差
          if (ageDiff > 0) {
            if (deathMonth == birthMonth) {
              let dayDiff = deathDay - birthDay;//日之差
              if (dayDiff < 0) {
                returnAge = ageDiff - 1;
              }
              else {
                returnAge = ageDiff;
              }
            }
            else {
              let monthDiff = deathMonth - birthMonth;//月之差
              if (monthDiff < 0) {
                returnAge = ageDiff - 1;
              }
              else {
                returnAge = ageDiff;
              }
            }
          }
          else {
            returnAge = -1;//返回-1 表示出生日期输入错误 晚于今天
          }
        }
        this.ruleForm.funeralDead.deadAge = returnAge;
      },
      getSta(id) {
        const postData = {
          parentId: id,
          asProvinceCityCounty: 1,
        };
        return new Promise((resolve, reject) => {
          Type["loadChildrenWithParentId"](postData)
            .then((response) => {
              // console.log(response)
              const {data} = response;
              if (!data) {
                reject();
              }
              resolve(data);
            })
            .catch((error) => {
              this.$message(error);
              reject();
            });
        });
      },
      age(type) {
        let nametype;
        if (this.copydictionary.age_type && this.copydictionary.age_type.length) {
          this.copydictionary.age_type.forEach((item) => {
            if (item.dataCode == type) {
              nametype = item.dataText;
            }
          });
          this.ruleForm.funeralDead.deadAge = "";
          if (nametype == "未知") {
            this.ruleForm.funeralDead.deadAge = "未知";
          }
        }
      },

      isValidDate(date) {
        return date instanceof Date && !isNaN(date.getTime());
      },

      //年龄变化触发死亡日期变化
      ageChange(type, age) {
        let nametype;
        this.copydictionary.age_type.forEach((item) => {
          if (item.dataCode == type) {
            nametype = item.dataText;
          }
        });
        if (this.ruleForm.funeralDead.birthDate) {
          if (nametype == "月") {
            //月
            let birthData = Date.parse(this.ruleForm.funeralDead.birthDate);
            this.ruleForm.funeralDead.deathDate = new Date(
              age * 30 * 24 * 3600 * 1000 + birthData
            );
          } else if (nametype == "年") {
            //年
            let birthData = Date.parse(this.ruleForm.funeralDead.birthDate);
            this.ruleForm.funeralDead.deathDate = new Date(
              age * 365 * 24 * 3600 * 1000 + birthData
            );
          }
        }
      },
      //年龄限制
      agelimit(age) {
        let pattern = new RegExp("[0-9]+");
        if (!pattern.test(age)) {
          this.$message("请输入数字");
          this.ruleForm.funeralDead.deadAge = "";
          return;
        }
        var nametype;
        this.copydictionary.age_type.forEach((item) => {
          if (item.dataCode == this.agetype) {
            nametype = item.dataText;
          }
        });
        if (nametype == "年" && age > 200) {
          this.$message("超出范围");
          this.ruleForm.funeralDead.deadAge = 200;
          return;
        }
        //月为单位
        if (nametype == "月") {
          if (age > 12) {
            this.ruleForm.funeralDead.deadAge = 12;
          } else if (age < 1) {
            this.ruleForm.funeralDead.deadAge = 1;
          }
        }
      },
      /*清空省市区县时清街道，村*/
      cityCountyClear(value) {
        if (!value) {
          //清空街道和村
          this.ruleForm.funeralDead.townId = null;
          this.ruleForm.funeralDead.villageId = null;
          //清空村的数据
          this.streetlist = [];
          this.copyStreetlist = [];
          this.villagelist = [];
          this.copyVillagelist = [];
        }
      },
      //实现街道办首字母搜索
      street_filter(val) {
        if (val) {
          let result = [];
          this.streetlist.map(function (currentValue) {
            if (currentValue.label.search(val) != -1) {//排头查询
              result.push(currentValue)
            } else {
              let keys = currentValue.abbr.split(',');
              keys.map(function (current) {
                if (current === val) {
                  result.push(currentValue)
                }
              })
            }
          })
          //搜索到相应的数据就把符合条件的n个数据赋值streetlist
          if (result.length) {
            this.streetlist = result
          } else {
            this.streetlist = this.copyStreetlist
          }
        } else {
          //没有搜索到数据，就还展示所有的streetlist
          this.streetlist = this.copyStreetlist
        }
      },
      //实现街道办首字母搜索
      driver_pinyin_filter(val) {
        if (val) {
          let result = [];
          this.driverUsers.filter((item) => {
            if (item.fullNameAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.driverUsers = result;
          });
        } else {
          this.driverUsers = this.copyDriverUsers;
        }
      },
      //清除街道，行政村团置空
      street_clear() {
        //清空街道和村
        this.ruleForm.funeralDead.townId = null;
        this.ruleForm.funeralDead.villageId = null;
        //清空村的数据
        this.villagelist = [];
        this.copyVillagelist = [];
      },
      //街道办行政村 注释 按钮点击事件
      // street_search() {
      //   this.$message("接口完善中");
      // },
      //反向查省市区县
      getCity(street) {
        let this_get = this;
        let data = this_get.options;
        if (data && data.length > 0) {
          data.forEach((item) => {
            if (item && item.children > 0) {
              let itemChild = item.children;
              itemChild.forEach((itemItem) => {
                if (itemItem && itemItem.value == street) {
                  this_get.ruleForm.funeralDead.provinceCityCountyId = item.value;
                }
              });
            }
          });
        }
        let tt = this_get.ruleForm.funeralDead.provinceCityCountyId;
      }, //反向查街道
      getStreed(village) {
        let this_streed = this;
        let data = this_streed.options;
        if (data && data.length) {
          data.forEach((item) => {
            item.forEach((itemItem) => {
              itemItem.forEach((itemItemItem) => {
                if (itemItemItem.label.indexOf(village) > 0) {
                  this_streed.ruleForm.funeralDead.provinceCityCountyId =
                    item.value;
                  this_streed.ruleForm.funeralDead.townId = itemItem.value;
                }
              });
            });
          });
        }
      },
      //去掉左右空格
      trim(str) {
        if (str == null) {
          return "";
        }
        return str.replace(/^\s*(.*?)[\s\n]*$/g, "$1");
      },
      //省市区数据改变时调用接口
      handleChange(value) {
        /*省市区县变化后村的数据都清空*/
        this.villagelist = [];
        //清空街道和村
        this.ruleForm.funeralDead.townId = null;
        this.ruleForm.funeralDead.villageId = null;
        //清空街道，村的数据
        this.streetlist = [];
        this.copyStreetlist = [];
        this.villagelist = [];
        this.copyVillagelist = [];
        if (value.length > 0) {
          let len = value.length;
          this.ruleForm.funeralDead.provinceCityCountyId = value[len - 1];
          //查询省市区县
          this.ruleForm.funeralDead.provinceCityCountyFullName = this.getProvinceFullName(
            value
          );
          //console.log(this.ruleForm.funeralDead.provinceCityCountyFullName, "加载街道")
          //加载街道
          this.loadstreet();
        }
      }, //获得省市区县的字符串
      getProvinceFullName(data) {
        //console.log(data,this.$store.getters.provinceCityCounty,"bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb");
        //省市区县数据
        //切换省市区县
        //let proData= provinceCityCounty
        let proData = this.$store.getters.provinceCityCounty;

        //省市区县字符串
        let proStr = "";
        let childrenOne = null;
        let childrenTwo = null;
        if (data && data.length > 0 && proData && proData.length > 0) {
          for (let i = 0; i < proData.length; i++) {
            if (data[0] != null && proData[i].value == data[0]) {
              proStr += proData[i].label;
              childrenOne = proData[i].children;
              break;
            }
          }
          if (data[1] != null && childrenOne && childrenOne.length > 0) {
            for (let j = 0; j < childrenOne.length; j++) {
              if (childrenOne[j].value == data[1]) {
                proStr = proStr + "/" + childrenOne[j].label;
                childrenTwo = childrenOne[j].children;
                break;
              }
            }
          }
          if (data[2] != null && childrenTwo && childrenTwo.length > 0) {
            for (let k = 0; k < childrenTwo.length; k++) {
              if (childrenTwo[k].value == data[2]) {
                proStr = proStr + "/" + childrenTwo[k].label;
                break;
              }
            }
          }
        }
        // console.log(proStr,"sssssssssssssssssssssssssssssssssssssssssssssssss");
        return proStr;
      },
      //数据读取
      ReadData() {
        this.ruleForm.coldPrintRemark = "";
        let this_read = this;
        let postData = {
          businessCode: this_read.businessCode,
        };
        this.loading = true;
        Type["loadwithbusinesscode"](postData)
          .then((response) => {
            console.log(response, "数据查询")
            if (!response) {
              //this.$message("数据读取失败");
              // this.$refs['ruleForm'].resetFields();
              this.businessCode = "";
              this.ruleForm.funeralDead = [];
              this.ruleForm.familyMember = [];
              this.ruleForm.familyAgent = [];
              this_read.ruleForm.chargeAllItems = [];
              this.ruleForm.coldPrintRemark = "";
              this.loading = false;
              this.$store.commit('user/SET_BUSINESSCODE', '')
              EventBus.$emit("reLoad")
              return;
            }
            const {data} = response;
            if (!data) {
              this.loading = false;
              this_read.$message("数据读取失败");
              return;
            }
            if (data.funeralDead) {
              this_read.ruleForm.funeralDead = data.funeralDead;
            }
            if (data.familyMember) {
              this_read.ruleForm.familyMember = data.familyMember;
            }
            if (data.familyAgent) {
              this_read.ruleForm.familyAgent = data.familyAgent;
            }
            //服务费用
            if (data.chargeAllItems) {
              this_read.ruleForm.chargeAllItems = data.chargeAllItems
            }
            //页面添加冷藏打印信息
            if (data.coldStorageId) {
              this_read.ruleForm.coldStorageId = data.coldStorageId;
              this_read.ruleForm.coldPrintRemark = data.coldPrintRemark;
            }
            if (
              typeof this.ruleForm.funeralDead.arrivedTime == "string" &&
              this.ruleForm.funeralDead.arrivedTime.indexOf("-") > -1
            ) {
              this.ruleForm.funeralDead.arrivedTime = this.ruleForm.funeralDead.arrivedTime.replace(
                /-/g,
                "/"
              );
            }
            this_read.$store
              .dispatch("user/setbusinessCode", this_read.businessCode)
              .catch(() => console.log("promise catch err"));
            this_read.modify = false;
            //查询成功后拍照备案等按钮可显
            this_read.photoBtnlimt = true;
            this_read.new_photolimit = false;
            this.isEdit = true;
            // 数据读取成功
            this_read.loadprovince();
            this_read.loadstreet();
            //定义村id
            let villageId = data.funeralDead.villageId;
            this_read.loadvillage(villageId);
            // this_read.ruleForm.funeralDead.provinceCityCountyFullName =
            //  data.funeralDead.provinceCityCountyFullName;
            //街道赋值
            this.loading = false;
            if (this.ruleForm.funeralDead.typeOfDeathCode) {
              let obj = {};
              obj = this.copydictionary.type_of_death.find((item) => {
                //这里的ClaOptions就是上面遍历的数据源
                return (
                  item.dataCode === this.ruleForm.funeralDead.typeOfDeathCode
                ); //筛选出匹配数据，这里的value是你遍历数组每一项的value，如果没有对后台返回的数据做处理，一般为id
              });
              //  console.log(obj.dataText);//  这里的label就是对应label的
              let dataText = obj.dataText;
              // console.log(dataText.indexOf("无名尸"));
              if (dataText.indexOf("无名尸") != -1) {
                this.isrequired = 1;
              } else {
                this.isrequired = 0;
              }
            }
          })
          .catch((error) => {
            this.$message(error);
            this.loading = false;
          });
      },
      searchData() {
        //当业务编码不存在时将businessCodeTitle赋值给businessCode
        if (this.businessCode === null && this.businessCode === "") {
          if (!this.businessCodeTitle) {
            this.$message("请输入业务编码");
            return;
          }
          //去除左右空格
          this.businessCode = this.trim(this.businessCodeTitle);
        } else {
          /* 当业务编码存在时 且businessCodeTitle不为空，与businessCode不相等时
          将businessCodeTitle赋值给businessCode*/
          if (this.businessCodeTitle !== null && this.businessCodeTitle !== ""
            && this.businessCodeTitle !== this.businessCode) {
            //去除左右空格
            this.businessCode = this.trim(this.businessCodeTitle);
          }
        }
        this.ReadData();
        this.businessCodeTitle = "";
      },
      //新增逝者火化档案
      AddInfo() {
        this.ruleForm = JSON.parse(JSON.stringify(this.copyruleForm));
        this.ruleForm.funeralDead.arrivedTime = new Date(); //到馆时间默认当前时间
        //国籍默认
        this.defaultValue();
        /*省市区县显示标志*/
        this.modify = true;
        /*拍照，打印显示标志*/
        this.new_photolimit = true;
        this.businessCode = "";
        this.$store
          .dispatch("user/setbusinessCode", this.businessCode)
          .catch(() => console.log("promise catch err"));
        // console.log(this.orginssq+"eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
        this.loadprovince();
        this.resetDefaultCode();
        //this.handleChange(this.orginssq);
      }, //默认值
      defaultValue() {
        //新增时默认值
        if (this.ruleForm.funeralDead.id == "") {
          //默认国籍
          // let countryData = this.copydictionary.nationality;
          // let readCountryData;
          // if (countryData!=undefined &&countryData!=null && countryData.length > 0) {
          //     let countryItem = null;
          //     for (let i = 0; i < countryData.length; i++) {
          //         countryItem = countryData[i];
          //         if (1 == countryItem.asDefault) {
          //             readCountryData = countryItem.dataCode;
          //             this.ruleForm.funeralDead.countyId = readCountryData;
          //             break;
          //         }
          //     }
          // }
          //性别
          this.ruleForm.funeralDead.deadGenderCode = this.getDefault(
            this.copydictionary.sex
          );

          this.ruleForm.funeralDead.countryCode = this.getDefault(
            this.copydictionary.nationality
          );
          //证件类型
          this.ruleForm.funeralDead.certificateTypeCode = this.getDefault(
            this.copydictionary.certificates
          );
          //民族
          this.ruleForm.funeralDead.deadNationCode = this.getDefault(
            this.copydictionary.nation
          );
          //逝者类型
          this.ruleForm.funeralDead.typeOfDeathCode = this.getDefault(
            this.copydictionary.type_of_death
          );
          //骨灰处理方式
          this.ruleForm.funeralDead.ashHandleTypeCode = this.getDefault(
            this.copydictionary.ashes_treatment
          );
          //省市区县
          //家属证件类型
          this.ruleForm.familyMember.certificateTypeCode = this.getDefault(
            this.copydictionary.certificates
          );
          //承办人类型
          this.ruleForm.familyAgent.agentType = this.getDefault(
            this.copydictionary.agent_type
          );

          //承办人证件类型
          this.ruleForm.familyAgent.certificateTypeCode = this.getDefault(
            this.copydictionary.certificates
          );
          //是否到馆
          this.ruleForm.funeralDead.asArrived = 1;
          //死亡原因
          //this.ruleForm.funeralDead.deathCause=this.getDefault(this.copydictionary.cause_of_death);
          this.ruleForm.funeralDead.deathCause = this.getDefaultText(
            this.copydictionary.cause_of_death
          );
          //遗体状态
          this.ruleForm.funeralDead.remainsStateCode = this.getDefault(
            this.copydictionary.remains_state
          );

          //减免类型 exemptionTypeCode
          this.ruleForm.funeralDead.exemptionTypeCode = this.getDefault(
            this.copydictionary.exemption_type
          );

          //逝者类型 typeOfDeathCode
          this.ruleForm.funeralDead.typeOfDeathCode = this.getDefault(
            this.copydictionary.type_of_death
          );
          //骨灰处理方式
          this.ruleForm.funeralDead.ashHandleTypeCode = this.getDefault(
            this.copydictionary.ashes_treatment
          );
          //死亡证明出具单位
          this.ruleForm.funeralDead.deathCertificateUnit = this.getDefaultText(
            this.copydictionary.funeral_certificate_unit
          );

          //殡葬证明出具单位
          this.ruleForm.funeralDead.funeralCertificateUnit = this.getDefaultText(
            this.copydictionary.burial_certificate_unit
          );
          //洽谈员
          // if (this.negotiator_user && this.negotiator_user.length > 0) {
          //   for (let i = 0; i < this.negotiator_user.length; i++) {
          //     if (this.negotiator_user[i].id === getUserInfo().userId) {
          //       this.ruleForm.funeralDead.negotiatorUserId = getUserInfo().userId;
          //     }
          //   }
          // }
        }
      }, //设置默认值
      getDefault(data) {
        let item = null;
        let readValue = "";
        if (data && data.length > 0) {
          for (let i = 0; i < data.length; i++) {
            item = data[i];
            //console.log(item.asDefault+item.dataText+"rrrrrrrrrrrrrrrrrrrrrrrrrrrrr");
            if (1 == item.asDefault) {
              readValue = item.dataCode;
              break;
            }
          }
        }
        return readValue;
      },
      //设置默认值
      getDefaultText(data) {
        let item = null;
        let readValue = "";
        if (data && data.length > 0) {
          for (let i = 0; i < data.length; i++) {
            item = data[i];
            //console.log(item.asDefault+item.dataText+"rrrrrrrrrrrrrrrrrrrrrrrrrrrrr");
            if (1 == item.asDefault) {
              readValue = item.dataText;
              break;
            }
          }
        }
        return readValue;
      },
      //业务查询显示
      businessSearchShow() {
        this.DialogSearch = true;
        //
      }, //业务查询显示
      photoRecordShow() {
        this.DialogPhotoRecord = true;
        //
      },
      onSubmit() {
      },
      checkCertificateNo(route) {
        //无名尸不必校验身份证号
        if (this.ruleForm.funeralDead.typeOfDeathCode === 1) {
          this.Save();
          return;
        }
        //查询是否存在相同逝者身份证号
        let certificateNodata = {
          "certificateNo": this.ruleForm.funeralDead.certificateNo,
          "funeralDeadId": this.ruleForm.funeralDead.id
        }
        Type['loadAlikeFuneralDeadWithCertificateNo'](certificateNodata).then(response => {

          if (response.message !== null && response.message !== "") {
            this.dialogVisible = true;


          } else {
            if (route !== null && route !== "") {
              this.Save(route);
            } else {
              this.Save();
            }
          }
        })
      },
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          if (valid) {
            alert("submit!");
          } else {
            return false;
          }
        });
      },
      //逝者信息保存方法
      Save(route) {
        if (this.serviceRoute !== null && this.serviceRoute !== "") {
          route = this.serviceRoute
        }
        //关闭重复身份证号弹窗
        this.dialogVisible = false
        //验证非空
        if (Date.now() - this.onpresscTime > 2000) {
          this.onpresscTime = Date.now();
          console.log(Date.now());
        } else {
          return;
        }
        this.$refs["homeRuleForm"].validate((valid) => {
          if (valid) {
            if (this.ruleForm.funeralDead.certificateNo !== "") {
              console.log(this.ruleForm.funeralDead.certificateTypeCode, "逝者身份证类型")
              console.log(this.ruleForm.familyMember.certificateTypeCode, "家属身份证类型")
              console.log(this.ruleForm.familyAgent.certificateTypeCode, "承办人身份证类型")
              // 判断逝者和家属证件类型是否为一样
              if (this.ruleForm.funeralDead.certificateTypeCode
                === this.ruleForm.familyMember.certificateTypeCode) {
                // 再判断证件号是否一样
                if (this.ruleForm.funeralDead.certificateNo ===
                  this.ruleForm.familyMember.certificateNo) {
                  this.$message("逝者,家属证件号码不能一致");
                  return;
                }
              }
              //判断逝者和承办人证件类型是否为一样
              if (this.ruleForm.funeralDead.certificateTypeCode
                === this.ruleForm.familyAgent.certificateTypeCode) {
                //判断逝者和承办人证号
                if (this.ruleForm.funeralDead.certificateNo
                  === this.ruleForm.familyAgent.certificateNo) {
                  this.$message("逝者, 承办人 证件号码不能一致");
                  return;
                }
              } else if (
                // 判断家属和承办人证件类型
                this.ruleForm.familyMember.certificateTypeCode
                === this.ruleForm.familyAgent.certificateTypeCode
              ) {
                //判断家属和承办人证件证号
                if (this.ruleForm.familyMember.certificateNo
                  === this.ruleForm.familyAgent.certificateNo) {
                  this.$message("逝者,(家属或承办人)证件号码不能一致");
                  return;
                }
              }
            }

            //this.saveFlag = true;
            var obj = {};

            Object.assign(obj, this.ruleForm);
            obj.funeralDead.arrivedTime = dataFormate(
              new Date(obj.funeralDead.arrivedTime)
            );
            obj.funeralDead.deathDate = dataFormatetmd(
              new Date(obj.funeralDead.deathDate)
            );
            obj.funeralDead.birthDate = dataFormatetmd(
              new Date(obj.funeralDead.birthDate)
            );

            if (obj.funeralDead.driverUserId != "" && obj.funeralDead.driverUserId > 0) {
              //console.log("driver:"+obj.funeralDead.driverUserId);
              for (let i = 0; i < this.driverUsers.length; i++) {
                //console.log("iii:"+this.driverUsers[i].id);
                if (obj.funeralDead.driverUserId == this.driverUsers[i].id) {
                  obj.funeralDead.asOutsideDriver = this.driverUsers[i].asOutsideDriver;
                  break;
                }
              }
            } else {
              obj.funeralDead.asOutsideDriver = "";
            }
            let postData = {
              funeralDead: obj.funeralDead,
              familyMember: obj.familyMember,
              familyAgent: obj.familyAgent,
              //冷藏业务主键
              coldStorageId: this.ruleForm.coldStorageId,
              //冷藏业务打印备注
              coldPrintRemark: this.ruleForm.coldPrintRemark,
              chargeAllItems: this.ruleForm.chargeAllItems
            };
            //   console.log(obj.funeralDead);
            this.$confirm(
              "此逝者姓名为: <span style='color:red;font-size:30px'>" +
              this.ruleForm.funeralDead.deadName +
              "</span> ，是否进行保存?",
              "提示",
              {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                dangerouslyUseHTMLString: true,
                type: "warning",
              }
            ).then(() => {
              //表单验证
              return new Promise((resolve, reject) => {
                Type["savecremationarchives"](postData)
                  .then((response) => {

                    // console.log(response)
                    const {data} = response;
                    if (!data) {
                      //this.saveFlag = false;
                      this.$message("保存数据失败");
                      return;
                    }
                    const {funeralDead, familyMember, familyAgent, chargeAllItems} = data;
                    if (funeralDead.businessCode) {
                      this.businessCode = funeralDead.businessCode;
                      this.$store
                        .dispatch("user/setbusinessCode", this.businessCode)
                        .catch(() => console.log("promise catch err"));
                    }
                    //  console.log(funeralDead);
                    this.ruleForm.funeralDead = funeralDead;
                    this.ruleForm.familyMember = familyMember;
                    this.ruleForm.familyAgent = familyAgent;
                    this.ruleForm.chargeAllItems = chargeAllItems;
                    if (
                      typeof this.ruleForm.funeralDead.arrivedTime ==
                      "string" &&
                      this.ruleForm.funeralDead.arrivedTime.indexOf("-") > -1
                    ) {
                      this.ruleForm.funeralDead.arrivedTime = this.ruleForm.funeralDead.arrivedTime.replace(/-/g, "/");
                    }
                    //this.saveFlag = false;
                    //查询成功后拍照备案等按钮可显
                    this.new_photolimit = false;
                    this.photoBtnlimt = true;
                    resolve(data);
                    this.$message("保存数据成功");
                    // this.negotiatorUserId_disabled = true
                    this.loadCremationCertificate();
                  })
              });
            })
              .catch(() => {
                //this.saveFlag = false;
              });
          } else {
            //说明未通过校验,保存失败
            let str = "";
            let arry = [
              {
                first: "funeralDead",
                name: "deadName",
                message: "请输入逝者姓名",
              },
              {
                first: "familyMember",
                name: "agentType",
                message: "请选择承办人类型",
              },
              {
                first: "funeralDead",
                name: "remainsStateCode",
                message: "请选择遗体状态",
              },
              {
                first: "funeralDead",
                name: "arrivedTime",
                message: "请选择到馆时间",
                required: 1,
              },
              {
                first: "familyAgent",
                name: "agentType",
                message: "请选择承办人类型",
              },
              {
                first: "familyAgent",
                name: "certificateTypeCode",
                message: "请选择承办证件类型",
              },
              {
                first: "familyAgent",
                name: "certificateNo",
                message: "请输入承办证件号码",
              },
              {
                first: "familyAgent",
                name: "agentRelation",
                message: "请选择承办与逝者关系",
              },
              {
                first: "familyAgent",
                name: "mobilePhone",
                message: "请输入承办手机号码",
              },
            ];
            var flag = false; //true时显示提示
            for (let i = 0; i < arry.length; i++) {
              if (arry[i]) {
                /*此为验证是否到馆为是时，到馆时间必填*/
                if (
                  arry[i].required &&
                  this.ruleForm[arry[i].first][arry[i].name] == "" &&
                  this.ruleForm.funeralDead.asArrived == 1
                ) {
                  flag = true;
                } else if (
                  !arry[i].required &&
                  typeof this.ruleForm[arry[i].first][arry[i].name] ==
                  "string" &&
                  this.ruleForm[arry[i].first][arry[i].name] == ""
                ) {
                  flag = true;
                } else if (
                  !arry[i].required &&
                  typeof this.ruleForm[arry[i].first][arry[i].name] ==
                  "number"
                ) {
                  let code = this.ruleForm[arry[i].first][arry[i].name] >= 0;
                  if (!code) {
                    flag = true;
                  }
                }
              }
            }
            if (flag) {
              this.$message("信息未填写完整");
            }
          }
        });

        if (this.ruleForm.coldStorageId === 0) {
          this.ruleForm.coldPrintRemark = "";
        }
      },
      SaveAndService() {
        this.serviceRoute = "home";
        this.checkCertificateNo("home");
      },

      PhotoArchival() {
        this.$router.push("PhotoArchival");
      }, //打印逝者二维码
      Print() {
        // console.log(132)
        //查询服务协议接口数据
        let this_print = this;
        let postData = {
          businessCode: this_print.businessCode,
        };
        Type["loadPrintCremationArchivesCodeWithBusinessCode"](postData)
          .then((response) => {
            //接收返回数据

            let result = response.data;
            //调用打印接口
            //  console.log(response)
            this_print.printCremationArchivesCode(result);
          })
          .catch((error) => {
            this_print.$message(error);
          });
      },
      printCremationArchivesCode(printData) {
        let this_print = this;
        let LODOP = getLodop();
        if (LODOP == null || !LODOP) {
          this_print.$.messager.alert(
            "系统提示",
            "您的浏览器不支持打印控件，请用IE重试或安装打印控件后重试"
          );
          return;
        }

        for (let key in printData.funeralDead) {
          printData["funeralDead"][key] = printData["funeralDead"][key]
            ? printData["funeralDead"][key]
            : "　";
        }
        // console.log(printData.funeralDead,666)
        //业务编码
        let businessCode = printData.funeralDead.businessCode;
        //逝者姓名
        let deadName = printData.funeralDead.deadName;
        //逝者死亡原因
        let deathCause = printData.funeralDead.deathCause;
        //逝者年龄
        let deadAge = printData.funeralDead.deadAge;
        //殡仪馆
        let firstParty = "XX殡仪馆";
        //逝者家属
        let memberName = printData.familyMember.memberName;
        //家属联系手机
        let mobilePhone = printData.familyMember.mobilePhone;

        //逝者性别
        let deadGender = printData.funeralDead.deadGender;
        //纸张
        //LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "A4");
        //设置字体
        // LODOP.SET_PRINT_STYLE("FontSize", 11);
        // //调用打印控件进行测试
        // LODOP.ADD_PRINT_BARCODE(39, 50, 100, 100, "QRCode", businessCode);
        // LODOP.ADD_PRINT_TEXT(39, 150, 350, 25, businessCode);
        // LODOP.ADD_PRINT_HTM(60, 150, 300, 25, "逝者: " + deadName);
        // LODOP.ADD_PRINT_TEXT(  90,150,350,25,"性别：" + deadGender + "年龄:" + deadAge);
        // LODOP.ADD_PRINT_HTM(120, 150, 300, 25, deathCause);
        // LODOP.ADD_PRINT_TEXT(150, 150, 300, 25, "家属姓名：" + memberName);

        LODOP.PRINT_INITA("0mm", "0mm", "68.8mm", "38.6mm", "二维条形码打印");
        LODOP.ADD_PRINT_BARCODE(
          "3.4mm",
          "2.4mm",
          "29.9mm",
          "29.9mm",
          "QRCode",
          businessCode
        );
        LODOP.SET_PRINT_STYLEA(0, "QRCodeVersion", 2);
        LODOP.SET_PRINT_STYLEA(0, "DataCharset", "UTF-8");
        LODOP.ADD_PRINT_TEXT("8.5mm", "31.2mm", "36.5mm", "6.6mm", deadName);
        LODOP.SET_PRINT_STYLEA(0, "FontName", "微软雅黑");
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.ADD_PRINT_TEXT("14.3mm", "41mm", "10.6mm", "5.6mm", deadAge);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.ADD_PRINT_TEXT("14.3mm", "31.8mm", "8.2mm", "6.6mm", deadGender);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.ADD_PRINT_TEXT("3.4mm", "31.2mm", "36.5mm", "6.6mm", businessCode);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 9);
        LODOP.SET_PRINT_STYLEA(0, "Bold", 1);
        LODOP.SET_PRINT_STYLEA(0, "LineSpacing", "-1.1mm");
        LODOP.SET_PRINT_STYLEA(0, "LetterSpacing", "0.3mm");
        LODOP.ADD_PRINT_TEXT("20.4mm", "31.8mm", "35.5mm", "6.6mm", deathCause);
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 11);
        LODOP.ADD_PRINT_TEXT(
          "26mm",
          "31mm",
          "67.6mm",
          "6.6mm",
          "联系方式：" + mobilePhone
        );
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 9);
        LODOP.ADD_PRINT_TEXT(
          "30mm",
          "31mm",
          "70.6mm",
          "6.6mm",
          "家属姓名：" + memberName
        );
        LODOP.SET_PRINT_STYLEA(0, "FontSize", 9);
        LODOP.ADD_PRINT_TEXT(121, 11, 100, 25, "遗体条码");

        //打印边框
        //LODOP.ADD_PRINT_RECT(60,55,500,300,0,1);
        // LODOP.ADD_PRINT_TABLE(115,50,300,300,tableStr);
        //直接打印
        //打印预览
        LODOP.PREVIEW();
        //LODOP.PRINT();
        //LODOP.PRINT_DESIGN();
      },

      //禁用行政区划
      disabledData(data) {
        if (data && data.length > 0) {
          data.forEach((item) => {
            if (item.disabled == 1) {
              item.disabled = true;
            }
            if (item.children) {
              this.disabledData(item.children);
            }
          });
        }
      },
      //加载省市县
      loadprovince() {
        // this.options = provinceCityCounty
        //切换省市区县
        this.options = this.$store.getters.provinceCityCounty;
        // console.log(this.options, "切换省市区县")
        let arry = JSON.parse(JSON.stringify(this.options));

        arry.forEach((item) => {
          item.children = [];
          this.option.push(item);
        });

      },
      //加载用户信息 洽谈元
      loaduserwithtypecode() {
        let postData = ["negotiator_user"];
        Type["loaduserwithtypecode"](postData)
          .then((response) => {
            const {data} = response;
            if (!data) {
              this.$message("加载数据失败");
              return;
            }
            //洽谈员
            // this.negotiator_user = data.negotiator_user;
            // if (this.negotiator_user && this.negotiator_user.length > 0) {
            //   for (let i = 0; i < this.negotiator_user.length; i++) {
            //     if (this.negotiator_user[i].id === getUserInfo().userId) {
            //       this.ruleForm.funeralDead.negotiatorUserId = getUserInfo().userId;
            //     }
            //   }
            // }
            // this.$set(this.copydictionary.negotiator_user,this.copydictionary.negotiator_user)
          })
          .catch((error) => {
            this.$message(error);
          });
      },
      //加载司机
      loadDriverUsers() {
        Type["loadDriverUser"]()
          .then((response) => {
            const {data} = response;
            if (!data) {
              this.$message("加载司机失败");
              return;
            }
            this.driverUsers = data;
            this.copyDriverUsers = data;
          })
          .catch((error) => {
            this.$message(error);
          });
      },
      //加载街道信息
      loadstreet() {
        if (!this.ruleForm.funeralDead.provinceCityCountyId) {
          return;
        }
        let postData = {
          id: this.ruleForm.funeralDead.provinceCityCountyId,
        };
        Type["loadstreetwithparentid"](postData)
          .then((response) => {
            const {data} = response;
            if (!data) {
              this.$message("加载数据失败");
              return;
            }
            this.streetlist = data;
            this.copyStreetlist = data;
            this.$set(this.streetlist, data);
          })
          .catch((error) => {
            this.$message(error);
          });
        return this.streetlist;
      },
      //加载村信息
      loadvillage(val) {
        let this_load = this;
        if (!this_load.ruleForm.funeralDead.townId) {
          return;
        }
        let postData = {
          id: this_load.ruleForm.funeralDead.townId,
        };
        //清空选择村的数据
        if (!val) {
          this_load.ruleForm.funeralDead.villageId = null;
        }
        Type["loadvillagewithparentid"](postData)
          .then((response) => {
            const {data} = response;
            if (!data) {
              this_load.$message("加载数据失败");
              return;
            }
            this_load.villagelist = data;
            this_load.copyVillagelist = data;
            this_load.$nextTick(() => {
              if (val) {
                this_load.ruleForm.funeralDead.villageId = val;
              }
            });
          })
          .catch((error) => {
            this_load.$message(error);
          });
      },
      //首字母查询行政村
      town_filter(val) {
        if (val) {
          let result = [];
          this.villagelist.map(function (currentValue) {
            if (currentValue.label.search(val) != -1) {//排头查询
              result.push(currentValue)
            } else {
              let keys = currentValue.abbr.split(',');
              keys.map(function (current) {
                if (current === val) {
                  result.push(currentValue)
                }
              })
            }
          })
          //搜索到相应的数据就把符合条件的n个数据赋值villagelist
          if (result.length) {
            this.villagelist = result
          } else {
            this.villagelist = this.copyVillagelist
          }
        } else {
          //没有搜索到数据，就还展示所有的villagelist
          this.villagelist = this.copyVillagelist
        }
      },
      //加载街道
      changeTown(val) {
        /* let streetData=  this.streetlist;
                   let villData=this.villagelist;
                   let villItem=this.ruleForm.funeralDead.villageId;*/
      }, //是否到馆改变
      changeAsArrived(val) {
        if (
          this.ruleForm.funeralDead.asArrived == 1 &&
          this.ruleForm.funeralDead.id == ""
        ) {
          this.ruleForm.funeralDead.arrivedTime = new Date();
        }
      },
      modifychange() {
        //点击修改
        this.modify = !this.modify;
        //加载省市区县
        this.loadprovince();
      },
      clear() {
        this.copydictionary = JSON.parse(JSON.stringify(this.dictionary));
      },
      clear_driver() {
        this.driverUsers = this.copyDriverUsers;
      },
      focus() {
        this.copydictionary = JSON.parse(JSON.stringify(this.dictionary));
      },
      deathFocus() {
        this.copydictionary = JSON.parse(JSON.stringify(this.dictionary));
      }, //读取卡中的性别选择下拉
      selectChange() {
        //给业务编码设置焦点
        this.$refs.deathChange_ref.blur();
        this.$refs.homebusinessCode.focus();
      },
      //拼音检索开始
      PinyinMatchsex(val) {
        if (val) {
          let result = [];
          this.dictionary.sex.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.sex = result;
          });
        } else {
          this.copydictionary.sex = JSON.parse(
            JSON.stringify(this.dictionary.sex)
          );
        }
      },
      PinyinMatchcertificates(val) {
        if (val) {
          let result = [];
          this.dictionary.certificates.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.certificates = result;
          });
        } else {
          this.copydictionary.certificates = JSON.parse(
            JSON.stringify(this.dictionary.certificates)
          );
        }
      },
      PinyinMatchnationality(val) {
        if (val) {
          let result = [];
          this.dictionary.nationality.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.nationality = result;
          });
        } else {
          this.copydictionary.nationality = JSON.parse(
            JSON.stringify(this.dictionary.nationality)
          );
        }
      },

      //拼音或中文检索
      PinyinMatchnation(val) {
        if (val) {
          let result = [];
          this.dictionary.nation.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            } else if (item.dataText && item.dataText.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.nation = result;
          });
        } else {
          this.copydictionary.nation = JSON.parse(
            JSON.stringify(this.dictionary.nation)
          );
        }
      },
      PinyinMatchcause_of_death(val) {
        if (val) {
          let result = [];
          this.dictionary.cause_of_death.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.cause_of_death = result;
          });
        } else {
          this.copydictionary.cause_of_death = JSON.parse(
            JSON.stringify(this.dictionary.cause_of_death)
          );
        }
      },
      PinyinMatchremains_state(val) {
        if (val) {
          let result = [];
          this.dictionary.remains_state.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.remains_state = result;
          });
        } else {
          this.copydictionary.remains_state = JSON.parse(
            JSON.stringify(this.dictionary.remains_state)
          );
        }
      },
      PinyinMatchexemption_type(val) {
        if (val) {
          let result = [];
          this.dictionary.exemption_type.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.exemption_type = result;
          });
        } else {
          this.copydictionary.exemption_type = JSON.parse(
            JSON.stringify(this.dictionary.exemption_type)
          );
        }
      },
      PinyinMatchcremation_type(val) {
        if (val) {
          let result = [];
          this.dictionary.cremation_type.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.cremation_type = result;
          });
        } else {
          this.copydictionary.cremation_type = JSON.parse(
            JSON.stringify(this.dictionary.cremation_type)
          );
        }
      },
      PinyinMatch_burial_certificate_unit(val) {
        this.tmpFuneralDead_FuneralCertificateUnit = val
        if (val) {
          let result = [];
          this.dictionary.burial_certificate_unit.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
          });
          this.copydictionary.burial_certificate_unit = result
        } else {
          this.copydictionary.burial_certificate_unit = JSON.parse(
            JSON.stringify(this.dictionary.burial_certificate_unit)
          );
        }
      },
      PinyinMatchtreatment_of_ashes(val) {
        if (val) {
          let result = [];
          this.dictionary.treatment_of_ashes.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.treatment_of_ashes = result;
          });
        } else {
          this.copydictionary.treatment_of_ashes = JSON.parse(
            JSON.stringify(this.dictionary.treatment_of_ashes)
          );
        }
      },
      PinyinMatchhuimin_region(val) {
        if (val) {
          let result = [];
          this.dictionary.huimin_region.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.huimin_region = result;
          });
        } else {
          this.copydictionary.huimin_region = JSON.parse(
            JSON.stringify(this.dictionary.huimin_region)
          );
        }
      },
      PinyinMatchnegotiator_user(val) {
        if (val) {
          let result = [];
          this.dictionary.negotiator_user.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.negotiator_user = result;
          });
        } else {
          this.copydictionary.negotiator_user = JSON.parse(
            JSON.stringify(this.dictionary.negotiator_user)
          );
        }
      },
      PinyinMatchagent_type(val) {
        if (val) {
          let result = [];
          this.dictionary.agent_type.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.agent_type = result;
          });
        } else {
          this.copydictionary.agent_type = JSON.parse(
            JSON.stringify(this.dictionary.agent_type)
          );
        }
      },
      PinyinMatchrelationship_with_deceased(val) {
        if (val) {
          let result = [];
          this.dictionary.relationship_with_deceased.filter((item) => {
            if (item.dataTextAbbr.indexOf(val) != -1) {
              result.push(item);
            }
            this.copydictionary.relationship_with_deceased = result;
          });
        } else {
          this.copydictionary.relationship_with_deceased = JSON.parse(
            JSON.stringify(this.dictionary.relationship_with_deceased)
          );
        }
      },
      //拼音检索结束
      //根据文本返回字典code值
      CodeInString(search_str, searchArry) {
        if (search_str && searchArry.length > 0) {
          searchArry.forEach((item) => {
            if (item.dataText.indexOf(search_str) > -1) {
              return item.dataCode;
            }
          });
        }
      },
      // IdCard_SS628_100_001U对应读卡器读取方法
      // 逝者身份证读取
      readDeadIdCard(type) {
        //let res=GPY_S620A3XR.idCard.readIdCard();

        let res = IdCard.idCard.load("idCardContainer").readIdCard();
        //性别 男或女
        let sexData = this.copydictionary.sex;
        let readSexData;
        if (sexData.length > 0) {
          let sexItem = null;
          let readSex = res && res.sex;
          for (let i = 0; i < sexData.length; i++) {
            sexItem = sexData[i];
            if (readSex == sexItem.dataText) {
              readSexData = sexItem.dataCode;
              break;
            }
          }
        }
        //居民身份证类型
        let certificateTypeData = this.copydictionary.certificates;
        let readCertificateData;
        if (certificateTypeData.length > 0) {
          let certItem = null;
          let readCertificate = "内地居民身份证";
          for (let i = 0; i < sexData.length; i++) {
            certItem = certificateTypeData[i];
            if (readCertificate == certItem.dataText) {
              readCertificateData = certItem.dataCode;
              break;
            }
          }
        }
        //国籍
        let countryData = this.copydictionary.nationality;
        let readCountryData;
        if (countryData.length > 0) {
          let countryItem = null;
          let readCountry = "中国";
          for (let i = 0; i < countryData.length; i++) {
            countryItem = countryData[i];
            if (readCountry == countryItem.dataText) {
              readCountryData = countryItem.dataCode;
              break;
            }
          }
        }

        if (type == "funeralDead") {
          // 姓名
          this.ruleForm.funeralDead.deadName = res && res.name;
          // 性别 读取男或女
          //给选择框赋值
          this.ruleForm.funeralDead.deadGenderCode = readSexData;
          // 逝者民族
          let nationData = this.copydictionary.nation;
          if (nationData.length > 0) {
            let nationItem = null;
            let readNation = res && res.nation;
            readNation += "族";
            for (let i = 0; i < nationData.length; i++) {
              nationItem = nationData[i];
              if (readNation == nationItem.dataText) {
                let selNationData = nationItem.dataCode;
                //给选择框赋值
                this.ruleForm.funeralDead.deadNationCode = selNationData;

                break;
              }
            }
          }
          // 出生日期
          //this.ruleForm.funeralDead.birthDate = res && res.birthDate;
          // 逝者国籍，默认中国
          this.ruleForm.funeralDead.countryCode = readCountryData;
          // 逝者民族
          // this.ruleForm.funeralDead.deadNationCode=res && res.nation;
          // 逝者证件类型和证件号码
          this.ruleForm.funeralDead.certificateTypeCode = readCertificateData; // 证件类型，默认身份证
          this.ruleForm.funeralDead.certificateNo = res && res.idCardNo; // 证件号码
          // 逝者户籍地
          this.ruleForm.funeralDead.householdRegistrationPlace =
            res && res.address;
          // 姓名
          this.ruleForm.funeralDead.deadName = res && res.name;
          // 性别
          //this.ruleForm.funeralDead.deadGenderCode = res && this.CodeInString(res.sex,this.copydictionary.sex)
          // 年龄=逝者死亡日期-逝者出生日期，界面上对年龄和死亡日期相互进行换算
          //this.ruleForm.funeralDead.deadAgeTypeCode=res && res.name;
          //this.ruleForm.funeralDead.deadAge=res && res.name;
          let birthDate = new Date(
            res.birthDate.replace("年", "-").replace("月", "-").replace("日", "")
          );

          this.ruleForm.funeralDead.birthDate = birthDate;
          // 逝者国籍，默认中国
          this.ruleForm.funeralDead.countryCode = readCountryData;
          // 逝者证件类型和证件号码
          this.ruleForm.funeralDead.certificateTypeCode = readCertificateData; // 证件类型，默认身份证
          this.ruleForm.funeralDead.certificateNo = res && res.idCardNo; // 证件号码
          // 逝者户籍地
          this.ruleForm.funeralDead.householdRegistrationPlace =
            res && res.address;
        } else if (type == "familyMember") {
          // 姓名
          this.ruleForm.familyMember.memberName = res && res.name;
          // 性别
          //给选择框赋值agentGenderCode
          this.ruleForm.familyMember.memberGenderCode = readSexData;
          this.ruleForm.familyMember.certificateNo = res && res.idCardNo; // 证件号码
          // 家属地址
          this.ruleForm.familyMember.address = res && res.address;
          this.ruleForm.familyMember.certificateTypeCode = readCertificateData; // 证件类型，默认身份证
        } else if (type == "familyAgent") {
          // 姓名
          this.ruleForm.familyAgent.agentName = res && res.name;
          // 性别
          this.ruleForm.familyAgent.agentGenderCode = readSexData;
          this.ruleForm.familyAgent.certificateNo = res && res.idCardNo; // 证件号码
          this.ruleForm.familyAgent.certificateTypeCode = readCertificateData; // 证件类型，默认身份证
          // 承办人联系地址
          this.ruleForm.familyAgent.address = res && res.address;
        }
      }, // 逝者身份证读取
      fs1000A3tdReadDeadIdCard(type) {
        //读取慧影身份证读卡器的内容
        //读取iccard的数据
        fsIdCard.FsIdCard.ReadIDCard();
        let this_read = this;
        //延迟加载执行函数
        setTimeout(function () {
          let res = fsIdCard.FsIdCard.getMsg();
          //console.log(JSON.stringify(res));
          //this_read.ruleForm.funeralDead.deadName = res.strSex;
          //开始处理
          let sexData = this_read.copydictionary.sex;
          let readSexData;
          if (sexData.length > 0) {
            let sexItem = null;
            let readSex = res && res.sex;
            for (let i = 0; i < sexData.length; i++) {
              sexItem = sexData[i];
              if (readSex == sexItem.dataText) {
                readSexData = sexItem.dataCode;
                break;
              }
            }
          }

          //居民身份证类型
          let certificateTypeData = this_read.copydictionary.certificates;
          let readCertificateData;
          if (certificateTypeData.length > 0) {
            let certItem = null;
            let readCertificate = "内地居民身份证";
            for (let i = 0; i < sexData.length; i++) {
              certItem = certificateTypeData[i];
              if (readCertificate == certItem.dataText) {
                readCertificateData = certItem.dataCode;
                break;
              }
            }
          }
          //国籍
          let countryData = this_read.copydictionary.nationality;
          let readCountryData;
          if (countryData.length > 0) {
            let countryItem = null;
            let readCountry = "中国";
            for (let i = 0; i < countryData.length; i++) {
              countryItem = countryData[i];
              if (readCountry == countryItem.dataText) {
                readCountryData = countryItem.dataCode;
                break;
              }
            }
          }

          if (type == "funeralDead") {
            // 姓名
            this_read.ruleForm.funeralDead.deadName = (res && res.name).replace(/^\s*(.*?)[\s\n]*$/g, "$1");
            // 性别 读取男或女
            //给选择框赋值
            this_read.ruleForm.funeralDead.deadGenderCode = readSexData;
            // 逝者民族
            let nationData = this_read.copydictionary.nation;
            if (nationData.length > 0) {
              let nationItem = null;
              let readNation = res && res.nation;
              readNation += "族";
              for (let i = 0; i < nationData.length; i++) {
                nationItem = nationData[i];
                if (readNation == nationItem.dataText) {
                  let selNationData = nationItem.dataCode;
                  //给选择框赋值
                  this_read.ruleForm.funeralDead.deadNationCode = selNationData;
                  //console.log(this_read.ruleForm.funeralDead.deadNationCode);
                  break;
                }
              }
            }
            //console.log(res.birthDate);
            // 出生日期

            //this_read.ruleForm.funeralDead.birthDate =
            // 逝者国籍，默认中国
            this_read.ruleForm.funeralDead.countryCode = readCountryData;
            // 逝者民族
            // this.ruleForm.funeralDead.deadNationCode=res && res.nation;
            // 逝者证件类型和证件号码
            this_read.ruleForm.funeralDead.certificateTypeCode = readCertificateData; // 证件类型，默认身份证
            this_read.ruleForm.funeralDead.certificateNo = res && res.idCardNo; // 证件号码
            // 逝者户籍地
            this_read.ruleForm.funeralDead.householdRegistrationPlace = (res && res.address).replace(/^\s*(.*?)[\s\n]*$/g, "$1");
            //生前住址
            this_read.ruleForm.funeralDead.beforeDeathAddress = (res && res.address).replace(/^\s*(.*?)[\s\n]*$/g, "$1");
            // 姓名
            this_read.ruleForm.funeralDead.deadName = (res && res.name).replace(/^\s*(.*?)[\s\n]*$/g, "$1");
            // 性别
            //this.ruleForm.funeralDead.deadGenderCode = res && this.CodeInString(res.sex,this.copydictionary.sex)
            // 年龄=逝者死亡日期-逝者出生日期，界面上对年龄和死亡日期相互进行换算
            //this.ruleForm.funeralDead.deadAgeTypeCode=res && res.name;
            //this.ruleForm.funeralDead.deadAge=res && res.name;
            // 出生日期
            let birthDate = new Date(
              res.birthDate
                .replace("年", "-")
                .replace("月", "-")
                .replace("日", "")
            );
            this_read.ruleForm.funeralDead.birthDate = birthDate;
            if (
              this_read.ruleForm.funeralDead.deathDate &&
              this_read.ruleForm.funeralDead.deathDate != null &&
              this_read.ruleForm.funeralDead.deathDate != ""
            ) {
              this_read.getAge();

            }
            // 逝者国籍，默认中国
            this_read.ruleForm.funeralDead.countryCode = readCountryData;
            // 逝者证件类型和证件号码
            this_read.ruleForm.funeralDead.certificateTypeCode = readCertificateData; // 证件类型，默认身份证
            this_read.ruleForm.funeralDead.certificateNo = res && res.idCardNo; // 证件号码
            // 逝者户籍地
            this_read.ruleForm.funeralDead.householdRegistrationPlace = (res && res.address).replace(/^\s*(.*?)[\s\n]*$/g, "$1");
          } else if (type == "familyMember") {
            //console.log(this_read.ruleForm.familyAgent.agentName + "承办人")
            //console.log(this_read.ruleForm.familyMember.memberName.length + "家属")
            // 姓名
            this_read.ruleForm.familyMember.memberName = (res && res.name).replace(/^\s*(.*?)[\s\n]*$/g, "$1");
            // 性别
            //给选择框赋值agentGenderCode
            this_read.ruleForm.familyMember.memberGenderCode = readSexData;
            this_read.ruleForm.familyMember.certificateNo = res && res.idCardNo; // 证件号码
            // 家属地址
            this_read.ruleForm.familyMember.address = (res && res.address).replace(/^\s*(.*?)[\s\n]*$/g, "$1");
            this_read.ruleForm.familyMember.certificateTypeCode = readCertificateData; // 证件类型，默认身份证
            if (
              this_read.ruleForm.familyMember.memberName.length > 0 &&
              this_read.ruleForm.familyAgent.agentName.length == 0
            ) {
              // 姓名
              this_read.ruleForm.familyAgent.agentName =
                this_read.ruleForm.familyMember.memberName;

              // 性别
              this_read.ruleForm.familyAgent.agentGenderCode =
                this_read.ruleForm.familyMember.memberGenderCode;
              this_read.ruleForm.familyAgent.certificateNo =
                this_read.ruleForm.familyMember.certificateNo; // 证件号码
              this_read.ruleForm.familyAgent.certificateTypeCode =
                this_read.ruleForm.familyMember.certificateTypeCode; // 证件类型，默认身份证
              // 承办人联系地址
              this_read.ruleForm.familyAgent.address =
                this_read.ruleForm.familyMember.address;
            }
          } else if (type == "familyAgent") {
            // console.log(this_read.ruleForm.familyAgent.agentName + "承办人")
            //  console.log(this_read.ruleForm.familyMember.memberName.length + "家属")

            // 姓名
            this_read.ruleForm.familyAgent.agentName = (res && res.name).replace(/^\s*(.*?)[\s\n]*$/g, "$1");

            // 性别
            this_read.ruleForm.familyAgent.agentGenderCode = readSexData;
            this_read.ruleForm.familyAgent.certificateNo = res && res.idCardNo; // 证件号码
            this_read.ruleForm.familyAgent.certificateTypeCode = readCertificateData; // 证件类型，默认身份证
            // 承办人联系地址
            this_read.ruleForm.familyAgent.address = (res && res.address).replace(/^\s*(.*?)[\s\n]*$/g, "$1");
          }
          //强制更新
          // this_read.$forceUpdate()
          //结束处理
        }, 1000);
        // let res = IdCard.idCard.load("idCardContainer").readIdCard();
        //性别 男或女
      }, //慧影设备加载
      fs1000A3tdOnLoding() {
        fsIdCard.FsIdCard.onLoad();
      },
      fs1000A3tdRead() {
        //读iccard
        fsIdCard.FsIdCard.ReadIDCard();
      },
      fs1000A3tdStop() {
        fsIdCard.FsIdCard.Stop();
      },
      selectChanged(vdataCode) {
        // console.log(vdataCode)
        let obj = {};
        obj = this.copydictionary.type_of_death.find((item) => {
          //这里的ClaOptions就是上面遍历的数据源
          return item.dataCode === vdataCode; //筛选出匹配数据，这里的value是你遍历数组每一项的value，如果没有对后台返回的数据做处理，一般为id
        });
        //  console.log(obj.dataText);//  这里的label就是对应label的
        let dataText = obj.dataText;
        // console.log(dataText.indexOf("无名尸"));
        if (dataText.indexOf("无名尸") != -1) {
          this.isrequired = 1;
        } else {
          this.isrequired = 0;
        }
        this.$forceUpdate()
        // console.log(this.isrequired);
      },
    },
    watch: {
      //当切换到无名尸的时候,清除表单校验
      // isrequired(n){
      //   if(n===1){
      //     this.$refs.homeRuleForm.clearValidate()
      //   }
      // },
      provinceCityCountyIds(n) {
        if (n.length) {
          this.ruleForm.funeralDead.provinceCityCountyId = n[n.length - 1]
        } else {
          this.ruleForm.funeralDead.provinceCityCountyId = ''
        }
      },
      /*省市*/
      "ruleForm.funeralDead.provinceCityCountyId"() {
        if (this.$refs.refHandle) {
          this.$refs.refHandle.dropDownVisible = false; //监听值发生变化就关闭它
        }
      },
      dictionary(n) {
        let dicData = this.dictionary;
        this.dictionary = dicData;
        this.copydictionary = JSON.parse(JSON.stringify(n));
      },
      'ruleForm.funeralDead.provinceCityCountyFullName': function () {
        this.fillResidence()//当省市区县,街道办及行政村均存在值的时候触发该方法,自动补充户籍地
      },
      'ruleForm.funeralDead.villageId': function () {
        this.fillResidence()//当省市区县,街道办及行政村均存在值的时候触发该方法,自动补充户籍地
      },
      "ruleForm.funeralDead.townId"() {
        if (this.ruleForm.funeralDead.townId) {
          this.loadvillage();
        }
        this.fillResidence()//当省市区县,街道办及行政村均存在值的时候触发该方法,自动补充户籍地
      },
      businessCodeParam() {
        if (this.businessCodeParam) {
          this.searchData();
        }
      },
    },
  };
</script>
<style>
  /*.cascader .el-form-item__label{*/
  /*width: 9vw!important;*/
  /*}*/

  .cascader .el-input,
  .cascader .select .el-input {
    width: 25.6vw !important;
    min-width: 40px;
  }

  .lineheight label {
    line-height: 20px !important;
    letter-spacing: 3px;
  }

  .streetwidth,
  .streetwidth input,
  .streetwidth .el-input,
  .streetwidth .el-select {
    /* width: 7vw !important; */
    min-width: 120px !important;
  }

  .agewidth,
  .agewidth input,
  .agewidth .el-input {
    width: 5vw !important;
    min-width: 90px !important;
    overflow: hidden;
  }

  .input-with-select .el-input-group__prepend {
    background-color: #fff;
  }

  .PageContent .zm .el-input,
  .PageContent .zm .el-select {
    width: 25.6vw;
    min-width: 40px;
  }

  .marginbottom0 .el-form-item {
    margin-bottom: 0px;
  }

  .home .el-textarea__inner {
    line-height: 2;
    min-height: 70px !important;
  }

  .home .el-select .el-input__inner {
    cursor: pointer;
    padding-right: 2px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home .PhotoRecordDialog.h100 {
    height: auto;
  }

  #funeralCertificateUnit .el-form-item__content {
    min-width: 360px;
  }

  #funeralCertificateUnit .el-form-item__content .el-select, #funeralCertificateUnit .el-form-item__content .el-select .el-input {
    width: 100%;
  }

  /*死亡证明编号*/
  /* #deathCertificateNo .el-form-item__content {
    min-width: 630px;
  } */

  #deathCertificateNo .el-form-item__content .el-select, #deathCertificateNo .el-form-item__content .el-select .el-input {
    width: 100%;
  }
</style>
<style scoped>
  .home {
    color: #606266;
  }

  .w1230 {
    width: 72.5vw !important;
    min-width: 40px !important;
  }

  .w425 {
    width: 25.6vw;
    min-width: 40px;
  }

  .letter2 {
    letter-spacing: 5px;
  }

  .childTable::before {
    background-color: #fff !important;
  }

  .childTable /deep/ .el-table__header-wrapper {
    display: none;
  }
</style>
